]> AND Private Git Repository - these_gilles.git/blob - DOCS/Scalable and Interactive Segmentation and Visualization of Neural Processes in EM Datasets_files/jquery.ui.widgets.min.js
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
modif finale lnivs + keywords
[these_gilles.git] / DOCS / Scalable and Interactive Segmentation and Visualization of Neural Processes in EM Datasets_files / jquery.ui.widgets.min.js
1 (function(a){a.widget("ui.accordion",{options:{active:0,animated:"slide",autoHeight:true,clearStyle:false,collapsible:false,event:"click",fillSpace:false,header:"> li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var b=this,c=b.options;b.running=0;b.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix");
2 b.headers=b.element.find(c.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){c.disabled||a(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){c.disabled||a(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){c.disabled||a(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){c.disabled||a(this).removeClass("ui-state-focus")});b.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom");
3 if(c.navigation){var d=b.element.find("a").filter(c.navigationFilter).eq(0);if(d.length){var f=d.closest(".ui-accordion-header");b.active=f.length?f:d.closest(".ui-accordion-content").prev()}}b.active=b._findActive(b.active||c.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");b.active.next().addClass("ui-accordion-content-active");b._createIcons();b.resize();b.element.attr("role","tablist");b.headers.attr("role","tab").bind("keydown.accordion",
4 function(g){return b._keydown(g)}).next().attr("role","tabpanel");b.headers.not(b.active||"").attr({"aria-expanded":"false","aria-selected":"false",tabIndex:-1}).next().hide();b.active.length?b.active.attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}):b.headers.eq(0).attr("tabIndex",0);a.browser.safari||b.headers.find("a").attr("tabIndex",-1);c.event&&b.headers.bind(c.event.split(" ").join(".accordion ")+".accordion",function(g){b._clickHandler.call(b,g,this);g.preventDefault()})},_createIcons:function(){var b=
5 this.options;if(b.icons){a("<span></span>").addClass("ui-icon "+b.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(b.icons.header).toggleClass(b.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var b=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("aria-selected").removeAttr("tabIndex");
6 this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var c=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(b.autoHeight||b.fillHeight)c.css("height","");return a.Widget.prototype.destroy.call(this)},_setOption:function(b,c){a.Widget.prototype._setOption.apply(this,arguments);b=="active"&&this.activate(c);if(b=="icons"){this._destroyIcons();
7 c&&this._createIcons()}if(b=="disabled")this.headers.add(this.headers.next())[c?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(b){if(!(this.options.disabled||b.altKey||b.ctrlKey)){var c=a.ui.keyCode,d=this.headers.length,f=this.headers.index(b.target),g=false;switch(b.keyCode){case c.RIGHT:case c.DOWN:g=this.headers[(f+1)%d];break;case c.LEFT:case c.UP:g=this.headers[(f-1+d)%d];break;case c.SPACE:case c.ENTER:this._clickHandler({target:b.target},b.target);
8 b.preventDefault()}if(g){a(b.target).attr("tabIndex",-1);a(g).attr("tabIndex",0);g.focus();return false}return true}},resize:function(){var b=this.options,c;if(b.fillSpace){if(a.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}c=this.element.parent().height();a.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){c-=a(this).outerHeight(true)});this.headers.next().each(function(){a(this).height(Math.max(0,c-a(this).innerHeight()+
9 a(this).height()))}).css("overflow","auto")}else if(b.autoHeight){c=0;this.headers.next().each(function(){c=Math.max(c,a(this).height("").height())}).height(c)}return this},activate:function(b){this.options.active=b;b=this._findActive(b)[0];this._clickHandler({target:b},b);return this},_findActive:function(b){return b?typeof b==="number"?this.headers.filter(":eq("+b+")"):this.headers.not(this.headers.not(b)):b===false?a([]):this.headers.filter(":eq(0)")},_clickHandler:function(b,c){var d=this.options;
10 if(!d.disabled)if(b.target){b=a(b.currentTarget||c);c=b[0]===this.active[0];d.active=d.collapsible&&c?false:this.headers.index(b);if(!(this.running||!d.collapsible&&c)){var f=this.active;h=b.next();i=this.active.next();e={options:d,newHeader:c&&d.collapsible?a([]):b,oldHeader:this.active,newContent:c&&d.collapsible?a([]):h,oldContent:i};var g=this.headers.index(this.active[0])>this.headers.index(b[0]);this.active=c?a([]):b;this._toggle(h,i,e,c,g);f.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);
11 if(!c){b.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected);b.next().addClass("ui-accordion-content-active")}}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);this.active.next().addClass("ui-accordion-content-active");var i=this.active.next(),
12 e={options:d,newHeader:a([]),oldHeader:d.active,newContent:a([]),oldContent:i},h=this.active=a([]);this._toggle(h,i,e)}},_toggle:function(b,c,d,f,g){var i=this,e=i.options;i.toShow=b;i.toHide=c;i.data=d;var h=function(){if(i)return i._completed.apply(i,arguments)};i._trigger("changestart",null,i.data);i.running=c.size()===0?b.size():c.size();if(e.animated){d={};d=e.collapsible&&f?{toShow:a([]),toHide:c,complete:h,down:g,autoHeight:e.autoHeight||e.fillSpace}:{toShow:b,toHide:c,complete:h,down:g,autoHeight:e.autoHeight||
13 e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=a.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=a.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;f=a.ui.accordion.animations;var j=e.duration,k=e.animated;if(k&&!f[k]&&!a.easing[k])k="slide";f[k]||(f[k]=function(l){this.slide(l,{easing:k,duration:j||700})});f[k](d)}else{if(e.collapsible&&f)b.toggle();else{c.hide();b.show()}h(true)}c.prev().attr({"aria-expanded":"false",
14 "aria-selected":"false",tabIndex:-1}).blur();b.prev().attr({"aria-expanded":"true","aria-selected":"true",tabIndex:0}).focus()},_completed:function(b){this.running=b?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");if(this.toHide.length)this.toHide.parent()[0].className=this.toHide.parent()[0].className;this._trigger("change",null,this.data)}}});a.extend(a.ui.accordion,{version:"1.8.17",
15 animations:{slide:function(b,c){b=a.extend({easing:"swing",duration:300},b,c);if(b.toHide.size())if(b.toShow.size()){var d=b.toShow.css("overflow"),f=0,g={},i={},e;c=b.toShow;e=c[0].style.width;c.width(c.parent().width()-parseFloat(c.css("paddingLeft"))-parseFloat(c.css("paddingRight"))-(parseFloat(c.css("borderLeftWidth"))||0)-(parseFloat(c.css("borderRightWidth"))||0));a.each(["height","paddingTop","paddingBottom"],function(h,j){i[j]="hide";h=(""+a.css(b.toShow[0],j)).match(/^([\d+-.]+)(.*)$/);
16 g[j]={value:h[1],unit:h[2]||"px"}});b.toShow.css({height:0,overflow:"hidden"}).show();b.toHide.filter(":hidden").each(b.complete).end().filter(":visible").animate(i,{step:function(h,j){if(j.prop=="height")f=j.end-j.start===0?0:(j.now-j.start)/(j.end-j.start);b.toShow[0].style[j.prop]=f*g[j.prop].value+g[j.prop].unit},duration:b.duration,easing:b.easing,complete:function(){b.autoHeight||b.toShow.css("height","");b.toShow.css({width:e,overflow:d});b.complete()}})}else b.toHide.animate({height:"hide",
17 paddingTop:"hide",paddingBottom:"hide"},b);else b.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},b)},bounceslide:function(b){this.slide(b,{easing:b.down?"easeOutBounce":"swing",duration:b.down?1E3:200})}}})})(jQuery);
18 (function(a){var b,c,d,f,g=function(){var e=a(this).find(":ui-button");setTimeout(function(){e.button("refresh")},1)},i=function(e){var h=e.name,j=e.form,k=a([]);if(h)k=j?a(j).find("[name='"+h+"']"):a("[name='"+h+"']",e.ownerDocument).filter(function(){return!this.form});return k};a.widget("ui.button",{options:{disabled:null,text:true,label:null,icons:{primary:null,secondary:null}},_create:function(){this.element.closest("form").unbind("reset.button").bind("reset.button",g);if(typeof this.options.disabled!==
19 "boolean")this.options.disabled=this.element.propAttr("disabled");this._determineButtonType();this.hasTitle=!!this.buttonElement.attr("title");var e=this,h=this.options,j=this.type==="checkbox"||this.type==="radio",k="ui-state-hover"+(!j?" ui-state-active":"");if(h.label===null)h.label=this.buttonElement.html();if(this.element.is(":disabled"))h.disabled=true;this.buttonElement.addClass("ui-button ui-widget ui-state-default ui-corner-all").attr("role","button").bind("mouseenter.button",function(){if(!h.disabled){a(this).addClass("ui-state-hover");
20 this===b&&a(this).addClass("ui-state-active")}}).bind("mouseleave.button",function(){h.disabled||a(this).removeClass(k)}).bind("click.button",function(l){if(h.disabled){l.preventDefault();l.stopImmediatePropagation()}});this.element.bind("focus.button",function(){e.buttonElement.addClass("ui-state-focus")}).bind("blur.button",function(){e.buttonElement.removeClass("ui-state-focus")});if(j){this.element.bind("change.button",function(){f||e.refresh()});this.buttonElement.bind("mousedown.button",function(l){if(!h.disabled){f=
21 false;c=l.pageX;d=l.pageY}}).bind("mouseup.button",function(l){if(!h.disabled)if(c!==l.pageX||d!==l.pageY)f=true})}if(this.type==="checkbox")this.buttonElement.bind("click.button",function(){if(h.disabled||f)return false;a(this).toggleClass("ui-state-active");e.buttonElement.attr("aria-pressed",e.element[0].checked)});else if(this.type==="radio")this.buttonElement.bind("click.button",function(){if(h.disabled||f)return false;a(this).addClass("ui-state-active");e.buttonElement.attr("aria-pressed","true");
22 var l=e.element[0];i(l).not(l).map(function(){return a(this).button("widget")[0]}).removeClass("ui-state-active").attr("aria-pressed","false")});else{this.buttonElement.bind("mousedown.button",function(){if(h.disabled)return false;a(this).addClass("ui-state-active");b=this;a(document).one("mouseup",function(){b=null})}).bind("mouseup.button",function(){if(h.disabled)return false;a(this).removeClass("ui-state-active")}).bind("keydown.button",function(l){if(h.disabled)return false;if(l.keyCode==a.ui.keyCode.SPACE||
23 l.keyCode==a.ui.keyCode.ENTER)a(this).addClass("ui-state-active")}).bind("keyup.button",function(){a(this).removeClass("ui-state-active")});this.buttonElement.is("a")&&this.buttonElement.keyup(function(l){l.keyCode===a.ui.keyCode.SPACE&&a(this).click()})}this._setOption("disabled",h.disabled);this._resetButton()},_determineButtonType:function(){this.type=this.element.is(":checkbox")?"checkbox":this.element.is(":radio")?"radio":this.element.is("input")?"input":"button";if(this.type==="checkbox"||this.type===
24 "radio"){var e=this.element.parents().filter(":last"),h="label[for='"+this.element.attr("id")+"']";this.buttonElement=e.find(h);if(!this.buttonElement.length){e=e.length?e.siblings():this.element.siblings();this.buttonElement=e.filter(h);if(!this.buttonElement.length)this.buttonElement=e.find(h)}this.element.addClass("ui-helper-hidden-accessible");(e=this.element.is(":checked"))&&this.buttonElement.addClass("ui-state-active");this.buttonElement.attr("aria-pressed",e)}else this.buttonElement=this.element},
25 widget:function(){return this.buttonElement},destroy:function(){this.element.removeClass("ui-helper-hidden-accessible");this.buttonElement.removeClass("ui-button ui-widget ui-state-default ui-corner-all ui-state-hover ui-state-active  ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only").removeAttr("role").removeAttr("aria-pressed").html(this.buttonElement.find(".ui-button-text").html());this.hasTitle||this.buttonElement.removeAttr("title");
26 a.Widget.prototype.destroy.call(this)},_setOption:function(e,h){a.Widget.prototype._setOption.apply(this,arguments);if(e==="disabled")h?this.element.propAttr("disabled",true):this.element.propAttr("disabled",false);else this._resetButton()},refresh:function(){var e=this.element.is(":disabled");e!==this.options.disabled&&this._setOption("disabled",e);if(this.type==="radio")i(this.element[0]).each(function(){a(this).is(":checked")?a(this).button("widget").addClass("ui-state-active").attr("aria-pressed",
27 "true"):a(this).button("widget").removeClass("ui-state-active").attr("aria-pressed","false")});else if(this.type==="checkbox")this.element.is(":checked")?this.buttonElement.addClass("ui-state-active").attr("aria-pressed","true"):this.buttonElement.removeClass("ui-state-active").attr("aria-pressed","false")},_resetButton:function(){if(this.type==="input")this.options.label&&this.element.val(this.options.label);else{var e=this.buttonElement.removeClass("ui-button-icons-only ui-button-icon-only ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary ui-button-text-only"),
28 h=a("<span></span>",this.element[0].ownerDocument).addClass("ui-button-text").html(this.options.label).appendTo(e.empty()).text(),j=this.options.icons,k=j.primary&&j.secondary,l=[];if(j.primary||j.secondary){if(this.options.text)l.push("ui-button-text-icon"+(k?"s":j.primary?"-primary":"-secondary"));j.primary&&e.prepend("<span class='ui-button-icon-primary ui-icon "+j.primary+"'></span>");j.secondary&&e.append("<span class='ui-button-icon-secondary ui-icon "+j.secondary+"'></span>");if(!this.options.text){l.push(k?
29 "ui-button-icons-only":"ui-button-icon-only");this.hasTitle||e.attr("title",h)}}else l.push("ui-button-text-only");e.addClass(l.join(" "))}}});a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(e,h){e==="disabled"&&this.buttons.button("option",e,h);a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){var e=this.element.css("direction")===
30 "rtl";this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass(e?"ui-corner-right":"ui-corner-left").end().filter(":last").addClass(e?"ui-corner-left":"ui-corner-right").end().end()},destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");
31 a.Widget.prototype.destroy.call(this)}})})(jQuery);
32 (function(a,b){function c(){return++f}function d(){return++g}var f=0,g=0;a.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"<div></div>",remove:null,select:null,show:null,spinner:"<em>Loading&#8230;</em>",tabTemplate:"<li><a href='#{href}'><span>#{label}</span></a></li>"},_create:function(){this._tabify(true)},_setOption:function(i,e){if(i=="selected")this.options.collapsible&&
33 e==this.options.selected||this.select(e);else{this.options[i]=e;this._tabify()}},_tabId:function(i){return i.title&&i.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+c()},_sanitizeSelector:function(i){return i.replace(/:/g,"\\:")},_cookie:function(){var i=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+d());return a.cookie.apply(null,[i].concat(a.makeArray(arguments)))},_ui:function(i,e){return{tab:i,panel:e,index:this.anchors.index(i)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var i=
34 a(this);i.html(i.data("label.tabs")).removeData("label.tabs")})},_tabify:function(i){function e(m,p){m.css("display","");!a.support.opacity&&p.opacity&&m[0].style.removeAttribute("filter")}var h=this,j=this.options,k=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=a(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return a("a",this)[0]});this.panels=a([]);this.anchors.each(function(m,p){var u=a(p).attr("href"),x=u.split("#")[0],w;if(x&&(x===location.toString().split("#")[0]||
35 (w=a("base")[0])&&x===w.href)){u=p.hash;p.href=u}if(k.test(u))h.panels=h.panels.add(h.element.find(h._sanitizeSelector(u)));else if(u&&u!=="#"){a.data(p,"href.tabs",u);a.data(p,"load.tabs",u.replace(/#.*$/,""));u=h._tabId(p);p.href="#"+u;p=h.element.find("#"+u);if(!p.length){p=a(j.panelTemplate).attr("id",u).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(h.panels[m-1]||h.list);p.data("destroy.tabs",true)}h.panels=h.panels.add(p)}else j.disabled.push(m)});if(i){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all");
36 this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(j.selected===b){location.hash&&this.anchors.each(function(m,p){if(p.hash==location.hash){j.selected=m;return false}});if(typeof j.selected!=="number"&&j.cookie)j.selected=parseInt(h._cookie(),10);if(typeof j.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)j.selected=
37 this.lis.index(this.lis.filter(".ui-tabs-selected"));j.selected=j.selected||(this.lis.length?0:-1)}else if(j.selected===null)j.selected=-1;j.selected=j.selected>=0&&this.anchors[j.selected]||j.selected<0?j.selected:0;j.disabled=a.unique(j.disabled.concat(a.map(this.lis.filter(".ui-state-disabled"),function(m){return h.lis.index(m)}))).sort();a.inArray(j.selected,j.disabled)!=-1&&j.disabled.splice(a.inArray(j.selected,j.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active");
38 if(j.selected>=0&&this.anchors.length){h.element.find(h._sanitizeSelector(h.anchors[j.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(j.selected).addClass("ui-tabs-selected ui-state-active");h.element.queue("tabs",function(){h._trigger("show",null,h._ui(h.anchors[j.selected],h.element.find(h._sanitizeSelector(h.anchors[j.selected].hash))[0]))});this.load(j.selected)}a(window).bind("unload",function(){h.lis.add(h.anchors).unbind(".tabs");h.lis=h.anchors=h.panels=null})}else j.selected=this.lis.index(this.lis.filter(".ui-tabs-selected"));
39 this.element[j.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");j.cookie&&this._cookie(j.selected,j.cookie);i=0;for(var l;l=this.lis[i];i++)a(l)[a.inArray(i,j.disabled)!=-1&&!a(l).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");j.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(j.event!=="mouseover"){var n=function(m,p){p.is(":not(.ui-state-disabled)")&&p.addClass("ui-state-"+m)},s=function(m,p){p.removeClass("ui-state-"+
40 m)};this.lis.bind("mouseover.tabs",function(){n("hover",a(this))});this.lis.bind("mouseout.tabs",function(){s("hover",a(this))});this.anchors.bind("focus.tabs",function(){n("focus",a(this).closest("li"))});this.anchors.bind("blur.tabs",function(){s("focus",a(this).closest("li"))})}var r,v;if(j.fx)if(a.isArray(j.fx)){r=j.fx[0];v=j.fx[1]}else r=v=j.fx;var o=v?function(m,p){a(m).closest("li").addClass("ui-tabs-selected ui-state-active");p.hide().removeClass("ui-tabs-hide").animate(v,v.duration||"normal",
41 function(){e(p,v);h._trigger("show",null,h._ui(m,p[0]))})}:function(m,p){a(m).closest("li").addClass("ui-tabs-selected ui-state-active");p.removeClass("ui-tabs-hide");h._trigger("show",null,h._ui(m,p[0]))},q=r?function(m,p){p.animate(r,r.duration||"normal",function(){h.lis.removeClass("ui-tabs-selected ui-state-active");p.addClass("ui-tabs-hide");e(p,r);h.element.dequeue("tabs")})}:function(m,p){h.lis.removeClass("ui-tabs-selected ui-state-active");p.addClass("ui-tabs-hide");h.element.dequeue("tabs")};
42 this.anchors.bind(j.event+".tabs",function(){var m=this,p=a(m).closest("li"),u=h.panels.filter(":not(.ui-tabs-hide)"),x=h.element.find(h._sanitizeSelector(m.hash));if(p.hasClass("ui-tabs-selected")&&!j.collapsible||p.hasClass("ui-state-disabled")||p.hasClass("ui-state-processing")||h.panels.filter(":animated").length||h._trigger("select",null,h._ui(this,x[0]))===false){this.blur();return false}j.selected=h.anchors.index(this);h.abort();if(j.collapsible)if(p.hasClass("ui-tabs-selected")){j.selected=
43 -1;j.cookie&&h._cookie(j.selected,j.cookie);h.element.queue("tabs",function(){q(m,u)}).dequeue("tabs");this.blur();return false}else if(!u.length){j.cookie&&h._cookie(j.selected,j.cookie);h.element.queue("tabs",function(){o(m,x)});h.load(h.anchors.index(this));this.blur();return false}j.cookie&&h._cookie(j.selected,j.cookie);if(x.length){u.length&&h.element.queue("tabs",function(){q(m,u)});h.element.queue("tabs",function(){o(m,x)});h.load(h.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier.";
44 a.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(i){if(typeof i=="string")i=this.anchors.index(this.anchors.filter("[href$="+i+"]"));return i},destroy:function(){var i=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e=
45 a.data(this,"href.tabs");if(e)this.href=e;var h=a(this).unbind(".tabs");a.each(["href","load","cache"],function(j,k){h.removeData(k+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){a.data(this,"destroy.tabs")?a(this).remove():a(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});i.cookie&&this._cookie(null,i.cookie);return this},add:function(i,
46 e,h){if(h===b)h=this.anchors.length;var j=this,k=this.options;e=a(k.tabTemplate.replace(/#\{href\}/g,i).replace(/#\{label\}/g,e));i=!i.indexOf("#")?i.replace("#",""):this._tabId(a("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var l=j.element.find("#"+i);l.length||(l=a(k.panelTemplate).attr("id",i).data("destroy.tabs",true));l.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(h>=this.lis.length){e.appendTo(this.list);l.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[h]);
47 l.insertBefore(this.panels[h])}k.disabled=a.map(k.disabled,function(n){return n>=h?++n:n});this._tabify();if(this.anchors.length==1){k.selected=0;e.addClass("ui-tabs-selected ui-state-active");l.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){j._trigger("show",null,j._ui(j.anchors[0],j.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[h],this.panels[h]));return this},remove:function(i){i=this._getIndex(i);var e=this.options,h=this.lis.eq(i).remove(),j=this.panels.eq(i).remove();
48 if(h.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(i+(i+1<this.anchors.length?1:-1));e.disabled=a.map(a.grep(e.disabled,function(k){return k!=i}),function(k){return k>=i?--k:k});this._tabify();this._trigger("remove",null,this._ui(h.find("a")[0],j[0]));return this},enable:function(i){i=this._getIndex(i);var e=this.options;if(a.inArray(i,e.disabled)!=-1){this.lis.eq(i).removeClass("ui-state-disabled");e.disabled=a.grep(e.disabled,function(h){return h!=i});this._trigger("enable",null,
49 this._ui(this.anchors[i],this.panels[i]));return this}},disable:function(i){i=this._getIndex(i);var e=this.options;if(i!=e.selected){this.lis.eq(i).addClass("ui-state-disabled");e.disabled.push(i);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[i],this.panels[i]))}return this},select:function(i){i=this._getIndex(i);if(i==-1)if(this.options.collapsible&&this.options.selected!=-1)i=this.options.selected;else return this;this.anchors.eq(i).trigger(this.options.event+".tabs");return this},
50 load:function(i){i=this._getIndex(i);var e=this,h=this.options,j=this.anchors.eq(i)[0],k=a.data(j,"load.tabs");this.abort();if(!k||this.element.queue("tabs").length!==0&&a.data(j,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(i).addClass("ui-state-processing");if(h.spinner){var l=a("span",j);l.data("label.tabs",l.html()).html(h.spinner)}this.xhr=a.ajax(a.extend({},h.ajaxOptions,{url:k,success:function(n,s){e.element.find(e._sanitizeSelector(j.hash)).html(n);e._cleanup();h.cache&&a.data(j,
51 "cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[i],e.panels[i]));try{h.ajaxOptions.success(n,s)}catch(r){}},error:function(n,s){e._cleanup();e._trigger("load",null,e._ui(e.anchors[i],e.panels[i]));try{h.ajaxOptions.error(n,s,i,j)}catch(r){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this},
52 url:function(i,e){this.anchors.eq(i).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});a.extend(a.ui.tabs,{version:"1.8.17"});a.extend(a.ui.tabs.prototype,{rotation:null,rotate:function(i,e){var h=this,j=this.options,k=h._rotate||(h._rotate=function(l){clearTimeout(h.rotation);h.rotation=setTimeout(function(){var n=j.selected;h.select(++n<h.anchors.length?n:0)},i);l&&l.stopPropagation()});e=h._unrotate||(h._unrotate=!e?function(l){l.clientX&&
53 h.rotate(null)}:function(){t=j.selected;k()});if(i){this.element.bind("tabsshow",k);this.anchors.bind(j.event+".tabs",e);k()}else{clearTimeout(h.rotation);this.element.unbind("tabsshow",k);this.anchors.unbind(j.event+".tabs",e);delete this._rotate;delete this._unrotate}return this}})})(jQuery);
54 (function(a){a.widget("ui.resizable",a.ui.mouse,{widgetEventPrefix:"resize",options:{alsoResize:false,animate:false,animateDuration:"slow",animateEasing:"swing",aspectRatio:false,autoHide:false,containment:false,ghost:false,grid:false,handles:"e,s,se",helper:false,maxHeight:null,maxWidth:null,minHeight:10,minWidth:10,zIndex:1E3},_create:function(){var d=this,f=this.options;this.element.addClass("ui-resizable");a.extend(this,{_aspectRatio:!!f.aspectRatio,aspectRatio:f.aspectRatio,originalElement:this.element,
55 _proportionallyResizeElements:[],_helper:f.helper||f.ghost||f.animate?f.helper||"ui-resizable-helper":null});if(this.element[0].nodeName.match(/canvas|textarea|input|select|button|img/i)){/relative/.test(this.element.css("position"))&&a.browser.opera&&this.element.css({position:"relative",top:"auto",left:"auto"});this.element.wrap(a('<div class="ui-wrapper" style="overflow: hidden;"></div>').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(),
56 top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle=
57 this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=f.handles||(!a(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne",
58 nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var g=this.handles.split(",");this.handles={};for(var i=0;i<g.length;i++){var e=a.trim(g[i]),h=a('<div class="ui-resizable-handle '+("ui-resizable-"+e)+'"></div>');/sw|se|ne|nw/.test(e)&&h.css({zIndex:++f.zIndex});"se"==e&&h.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[e]=".ui-resizable-"+e;this.element.append(h)}}this._renderAxis=function(j){j=j||this.element;for(var k in this.handles){if(this.handles[k].constructor==
59 String)this.handles[k]=a(this.handles[k],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var l=a(this.handles[k],this.element),n=0;n=/sw|ne|nw|se|n|s/.test(k)?l.outerHeight():l.outerWidth();l=["padding",/ne|nw|n/.test(k)?"Top":/se|sw|s/.test(k)?"Bottom":/^e$/.test(k)?"Right":"Left"].join("");j.css(l,n);this._proportionallyResize()}a(this.handles[k])}};this._renderAxis(this.element);this._handles=a(".ui-resizable-handle",this.element).disableSelection();
60 this._handles.mouseover(function(){if(!d.resizing){if(this.className)var j=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);d.axis=j&&j[1]?j[1]:"se"}});if(f.autoHide){this._handles.hide();a(this.element).addClass("ui-resizable-autohide").hover(function(){if(!f.disabled){a(this).removeClass("ui-resizable-autohide");d._handles.show()}},function(){if(!f.disabled)if(!d.resizing){a(this).addClass("ui-resizable-autohide");d._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();
61 var d=function(g){a(g).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()};if(this.elementIsWrapper){d(this.element);var f=this.element;f.after(this.originalElement.css({position:f.css("position"),width:f.outerWidth(),height:f.outerHeight(),top:f.css("top"),left:f.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);d(this.originalElement);return this},_mouseCapture:function(d){var f=
62 false;for(var g in this.handles)if(a(this.handles[g])[0]==d.target)f=true;return!this.options.disabled&&f},_mouseStart:function(d){var f=this.options,g=this.element.position(),i=this.element;this.resizing=true;this.documentScroll={top:a(document).scrollTop(),left:a(document).scrollLeft()};if(i.is(".ui-draggable")||/absolute/.test(i.css("position")))i.css({position:"absolute",top:g.top,left:g.left});a.browser.opera&&/relative/.test(i.css("position"))&&i.css({position:"relative",top:"auto",left:"auto"});
63 this._renderProxy();g=b(this.helper.css("left"));var e=b(this.helper.css("top"));if(f.containment){g+=a(f.containment).scrollLeft()||0;e+=a(f.containment).scrollTop()||0}this.offset=this.helper.offset();this.position={left:g,top:e};this.size=this._helper?{width:i.outerWidth(),height:i.outerHeight()}:{width:i.width(),height:i.height()};this.originalSize=this._helper?{width:i.outerWidth(),height:i.outerHeight()}:{width:i.width(),height:i.height()};this.originalPosition={left:g,top:e};this.sizeDiff=
64 {width:i.outerWidth()-i.width(),height:i.outerHeight()-i.height()};this.originalMousePosition={left:d.pageX,top:d.pageY};this.aspectRatio=typeof f.aspectRatio=="number"?f.aspectRatio:this.originalSize.width/this.originalSize.height||1;f=a(".ui-resizable-"+this.axis).css("cursor");a("body").css("cursor",f=="auto"?this.axis+"-resize":f);i.addClass("ui-resizable-resizing");this._propagate("start",d);return true},_mouseDrag:function(d){var f=this.helper,g=this.originalMousePosition,i=this._change[this.axis];
65 if(!i)return false;g=i.apply(this,[d,d.pageX-g.left||0,d.pageY-g.top||0]);this._updateVirtualBoundaries(d.shiftKey);if(this._aspectRatio||d.shiftKey)g=this._updateRatio(g,d);g=this._respectSize(g,d);this._propagate("resize",d);f.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(g);this._trigger("resize",d,this.ui());return false},
66 _mouseStop:function(d){this.resizing=false;var f=this.options;if(this._helper){var g=this._proportionallyResizeElements,i=g.length&&/textarea/i.test(g[0].nodeName);g=i&&a.ui.hasScroll(g[0],"left")?0:this.sizeDiff.height;i=i?0:this.sizeDiff.width;i={width:this.helper.width()-i,height:this.helper.height()-g};g=parseInt(this.element.css("left"),10)+(this.position.left-this.originalPosition.left)||null;var e=parseInt(this.element.css("top"),10)+(this.position.top-this.originalPosition.top)||null;f.animate||
67 this.element.css(a.extend(i,{top:e,left:g}));this.helper.height(this.size.height);this.helper.width(this.size.width);this._helper&&!f.animate&&this._proportionallyResize()}a("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop",d);this._helper&&this.helper.remove();return false},_updateVirtualBoundaries:function(d){var f=this.options,g,i,e;f={minWidth:c(f.minWidth)?f.minWidth:0,maxWidth:c(f.maxWidth)?f.maxWidth:Infinity,minHeight:c(f.minHeight)?f.minHeight:
68 0,maxHeight:c(f.maxHeight)?f.maxHeight:Infinity};if(this._aspectRatio||d){d=f.minHeight*this.aspectRatio;i=f.minWidth/this.aspectRatio;g=f.maxHeight*this.aspectRatio;e=f.maxWidth/this.aspectRatio;if(d>f.minWidth)f.minWidth=d;if(i>f.minHeight)f.minHeight=i;if(g<f.maxWidth)f.maxWidth=g;if(e<f.maxHeight)f.maxHeight=e}this._vBoundaries=f},_updateCache:function(d){this.offset=this.helper.offset();if(c(d.left))this.position.left=d.left;if(c(d.top))this.position.top=d.top;if(c(d.height))this.size.height=
69 d.height;if(c(d.width))this.size.width=d.width},_updateRatio:function(d){var f=this.position,g=this.size,i=this.axis;if(c(d.height))d.width=d.height*this.aspectRatio;else if(c(d.width))d.height=d.width/this.aspectRatio;if(i=="sw"){d.left=f.left+(g.width-d.width);d.top=null}if(i=="nw"){d.top=f.top+(g.height-d.height);d.left=f.left+(g.width-d.width)}return d},_respectSize:function(d){var f=this._vBoundaries,g=this.axis,i=c(d.width)&&f.maxWidth&&f.maxWidth<d.width,e=c(d.height)&&f.maxHeight&&f.maxHeight<
70 d.height,h=c(d.width)&&f.minWidth&&f.minWidth>d.width,j=c(d.height)&&f.minHeight&&f.minHeight>d.height;if(h)d.width=f.minWidth;if(j)d.height=f.minHeight;if(i)d.width=f.maxWidth;if(e)d.height=f.maxHeight;var k=this.originalPosition.left+this.originalSize.width,l=this.position.top+this.size.height,n=/sw|nw|w/.test(g);g=/nw|ne|n/.test(g);if(h&&n)d.left=k-f.minWidth;if(i&&n)d.left=k-f.maxWidth;if(j&&g)d.top=l-f.minHeight;if(e&&g)d.top=l-f.maxHeight;if((f=!d.width&&!d.height)&&!d.left&&d.top)d.top=null;
71 else if(f&&!d.top&&d.left)d.left=null;return d},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var d=this.helper||this.element,f=0;f<this._proportionallyResizeElements.length;f++){var g=this._proportionallyResizeElements[f];if(!this.borderDif){var i=[g.css("borderTopWidth"),g.css("borderRightWidth"),g.css("borderBottomWidth"),g.css("borderLeftWidth")],e=[g.css("paddingTop"),g.css("paddingRight"),g.css("paddingBottom"),g.css("paddingLeft")];this.borderDif=a.map(i,
72 function(h,j){h=parseInt(h,10)||0;j=parseInt(e[j],10)||0;return h+j})}a.browser.msie&&(a(d).is(":hidden")||a(d).parents(":hidden").length)||g.css({height:d.height()-this.borderDif[0]-this.borderDif[2]||0,width:d.width()-this.borderDif[1]-this.borderDif[3]||0})}},_renderProxy:function(){var d=this.options;this.elementOffset=this.element.offset();if(this._helper){this.helper=this.helper||a('<div style="overflow:hidden;"></div>');var f=a.browser.msie&&a.browser.version<7,g=f?1:0;f=f?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+
73 f,height:this.element.outerHeight()+f,position:"absolute",left:this.elementOffset.left-g+"px",top:this.elementOffset.top-g+"px",zIndex:++d.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(d,f){return{width:this.originalSize.width+f}},w:function(d,f){return{left:this.originalPosition.left+f,width:this.originalSize.width-f}},n:function(d,f,g){return{top:this.originalPosition.top+g,height:this.originalSize.height-g}},s:function(d,f,g){return{height:this.originalSize.height+
74 g}},se:function(d,f,g){return a.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[d,f,g]))},sw:function(d,f,g){return a.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[d,f,g]))},ne:function(d,f,g){return a.extend(this._change.n.apply(this,arguments),this._change.e.apply(this,[d,f,g]))},nw:function(d,f,g){return a.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[d,f,g]))}},_propagate:function(d,f){a.ui.plugin.call(this,d,[f,this.ui()]);
75 d!="resize"&&this._trigger(d,f,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});a.extend(a.ui.resizable,{version:"1.8.17"});a.ui.plugin.add("resizable","alsoResize",{start:function(){var d=a(this).data("resizable").options,f=function(g){a(g).each(function(){var i=a(this);i.data("resizable-alsoresize",{width:parseInt(i.width(),
76 10),height:parseInt(i.height(),10),left:parseInt(i.css("left"),10),top:parseInt(i.css("top"),10),position:i.css("position")})})};if(typeof d.alsoResize=="object"&&!d.alsoResize.parentNode)if(d.alsoResize.length){d.alsoResize=d.alsoResize[0];f(d.alsoResize)}else a.each(d.alsoResize,function(g){f(g)});else f(d.alsoResize)},resize:function(d,f){var g=a(this).data("resizable");d=g.options;var i=g.originalSize,e=g.originalPosition,h={height:g.size.height-i.height||0,width:g.size.width-i.width||0,top:g.position.top-
77 e.top||0,left:g.position.left-e.left||0},j=function(k,l){a(k).each(function(){var n=a(this),s=a(this).data("resizable-alsoresize"),r={},v=l&&l.length?l:n.parents(f.originalElement[0]).length?["width","height"]:["width","height","top","left"];a.each(v,function(o,q){if((o=(s[q]||0)+(h[q]||0))&&o>=0)r[q]=o||null});if(a.browser.opera&&/relative/.test(n.css("position"))){g._revertToRelativePosition=true;n.css({position:"absolute",top:"auto",left:"auto"})}n.css(r)})};typeof d.alsoResize=="object"&&!d.alsoResize.nodeType?
78 a.each(d.alsoResize,function(k,l){j(k,l)}):j(d.alsoResize)},stop:function(){var d=a(this).data("resizable"),f=d.options,g=function(i){a(i).each(function(){var e=a(this);e.css({position:e.data("resizable-alsoresize").position})})};if(d._revertToRelativePosition){d._revertToRelativePosition=false;typeof f.alsoResize=="object"&&!f.alsoResize.nodeType?a.each(f.alsoResize,function(i){g(i)}):g(f.alsoResize)}a(this).removeData("resizable-alsoresize")}});a.ui.plugin.add("resizable","animate",{stop:function(d){var f=
79 a(this).data("resizable"),g=f.options,i=f._proportionallyResizeElements,e=i.length&&/textarea/i.test(i[0].nodeName),h=e&&a.ui.hasScroll(i[0],"left")?0:f.sizeDiff.height;e={width:f.size.width-(e?0:f.sizeDiff.width),height:f.size.height-h};h=parseInt(f.element.css("left"),10)+(f.position.left-f.originalPosition.left)||null;var j=parseInt(f.element.css("top"),10)+(f.position.top-f.originalPosition.top)||null;f.element.animate(a.extend(e,j&&h?{top:j,left:h}:{}),{duration:g.animateDuration,easing:g.animateEasing,
80 step:function(){var k={width:parseInt(f.element.css("width"),10),height:parseInt(f.element.css("height"),10),top:parseInt(f.element.css("top"),10),left:parseInt(f.element.css("left"),10)};i&&i.length&&a(i[0]).css({width:k.width,height:k.height});f._updateCache(k);f._propagate("resize",d)}})}});a.ui.plugin.add("resizable","containment",{start:function(){var d=a(this).data("resizable"),f=d.element,g=d.options.containment;if(f=g instanceof a?g.get(0):/parent/.test(g)?f.parent().get(0):g){d.containerElement=
81 a(f);if(/document/.test(g)||g==document){d.containerOffset={left:0,top:0};d.containerPosition={left:0,top:0};d.parentData={element:a(document),left:0,top:0,width:a(document).width(),height:a(document).height()||document.body.parentNode.scrollHeight}}else{var i=a(f),e=[];a(["Top","Right","Left","Bottom"]).each(function(k,l){e[k]=b(i.css("padding"+l))});d.containerOffset=i.offset();d.containerPosition=i.position();d.containerSize={height:i.innerHeight()-e[3],width:i.innerWidth()-e[1]};g=d.containerOffset;
82 var h=d.containerSize.height,j=d.containerSize.width;j=a.ui.hasScroll(f,"left")?f.scrollWidth:j;h=a.ui.hasScroll(f)?f.scrollHeight:h;d.parentData={element:f,left:g.left,top:g.top,width:j,height:h}}}},resize:function(d){var f=a(this).data("resizable"),g=f.options,i=f.containerOffset,e=f.position;d=f._aspectRatio||d.shiftKey;var h={top:0,left:0},j=f.containerElement;if(j[0]!=document&&/static/.test(j.css("position")))h=i;if(e.left<(f._helper?i.left:0)){f.size.width+=f._helper?f.position.left-i.left:
83 f.position.left-h.left;if(d)f.size.height=f.size.width/g.aspectRatio;f.position.left=g.helper?i.left:0}if(e.top<(f._helper?i.top:0)){f.size.height+=f._helper?f.position.top-i.top:f.position.top;if(d)f.size.width=f.size.height*g.aspectRatio;f.position.top=f._helper?i.top:0}f.offset.left=f.parentData.left+f.position.left;f.offset.top=f.parentData.top+f.position.top;g=Math.abs((f._helper?f.offset.left-h.left:f.offset.left-h.left)+f.sizeDiff.width);i=Math.abs((f._helper?f.offset.top-h.top:f.offset.top-
84 i.top)+f.sizeDiff.height);e=f.containerElement.get(0)==f.element.parent().get(0);h=/relative|absolute/.test(f.containerElement.css("position"));if(e&&h)g-=f.parentData.left;if(g+f.size.width>=f.parentData.width){f.size.width=f.parentData.width-g;if(d)f.size.height=f.size.width/f.aspectRatio}if(i+f.size.height>=f.parentData.height){f.size.height=f.parentData.height-i;if(d)f.size.width=f.size.height*f.aspectRatio}},stop:function(){var d=a(this).data("resizable"),f=d.options,g=d.containerOffset,i=d.containerPosition,
85 e=d.containerElement,h=a(d.helper),j=h.offset(),k=h.outerWidth()-d.sizeDiff.width;h=h.outerHeight()-d.sizeDiff.height;d._helper&&!f.animate&&/relative/.test(e.css("position"))&&a(this).css({left:j.left-i.left-g.left,width:k,height:h});d._helper&&!f.animate&&/static/.test(e.css("position"))&&a(this).css({left:j.left-i.left-g.left,width:k,height:h})}});a.ui.plugin.add("resizable","ghost",{start:function(){var d=a(this).data("resizable"),f=d.options,g=d.size;d.ghost=d.originalElement.clone();d.ghost.css({opacity:0.25,
86 display:"block",position:"relative",height:g.height,width:g.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof f.ghost=="string"?f.ghost:"");d.ghost.appendTo(d.helper)},resize:function(){var d=a(this).data("resizable");d.ghost&&d.ghost.css({position:"relative",height:d.size.height,width:d.size.width})},stop:function(){var d=a(this).data("resizable");d.ghost&&d.helper&&d.helper.get(0).removeChild(d.ghost.get(0))}});a.ui.plugin.add("resizable","grid",{resize:function(){var d=
87 a(this).data("resizable"),f=d.options,g=d.size,i=d.originalSize,e=d.originalPosition,h=d.axis;f.grid=typeof f.grid=="number"?[f.grid,f.grid]:f.grid;var j=Math.round((g.width-i.width)/(f.grid[0]||1))*(f.grid[0]||1);f=Math.round((g.height-i.height)/(f.grid[1]||1))*(f.grid[1]||1);if(/^(se|s|e)$/.test(h)){d.size.width=i.width+j;d.size.height=i.height+f}else if(/^(ne)$/.test(h)){d.size.width=i.width+j;d.size.height=i.height+f;d.position.top=e.top-f}else{if(/^(sw)$/.test(h)){d.size.width=i.width+j;d.size.height=
88 i.height+f}else{d.size.width=i.width+j;d.size.height=i.height+f;d.position.top=e.top-f}d.position.left=e.left-j}}});var b=function(d){return parseInt(d,10)||0},c=function(d){return!isNaN(parseInt(d,10))}})(jQuery);
89 (function(a,b){var c={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},d={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true},f=a.attrFn||{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true,click:true};a.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,
90 position:{my:"center",at:"center",collision:"fit",using:function(g){var i=a(this).css(g).offset().top;i<0&&a(this).css("top",g.top-i)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var g=this,i=g.options,e=i.title||"&#160;",h=a.ui.dialog.getTitleId(g.element),j=(g.uiDialog=a("<div></div>")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+
91 i.dialogClass).css({zIndex:i.zIndex}).attr("tabIndex",-1).css("outline",0).keydown(function(n){if(i.closeOnEscape&&!n.isDefaultPrevented()&&n.keyCode&&n.keyCode===a.ui.keyCode.ESCAPE){g.close(n);n.preventDefault()}}).attr({role:"dialog","aria-labelledby":h}).mousedown(function(n){g.moveToTop(false,n)});g.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(j);var k=(g.uiDialogTitlebar=a("<div></div>")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(j),
92 l=a('<a href="#"></a>').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role","button").hover(function(){l.addClass("ui-state-hover")},function(){l.removeClass("ui-state-hover")}).focus(function(){l.addClass("ui-state-focus")}).blur(function(){l.removeClass("ui-state-focus")}).click(function(n){g.close(n);return false}).appendTo(k);(g.uiDialogTitlebarCloseText=a("<span></span>")).addClass("ui-icon ui-icon-closethick").text(i.closeText).appendTo(l);a("<span></span>").addClass("ui-dialog-title").attr("id",
93 h).html(e).prependTo(k);if(a.isFunction(i.beforeclose)&&!a.isFunction(i.beforeClose))i.beforeClose=i.beforeclose;k.find("*").add(k).disableSelection();i.draggable&&a.fn.draggable&&g._makeDraggable();i.resizable&&a.fn.resizable&&g._makeResizable();g._createButtons(i.buttons);g._isOpen=false;a.fn.bgiframe&&j.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){this.overlay&&this.overlay.destroy();this.uiDialog.hide();this.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");
94 this.uiDialog.remove();this.originalTitle&&this.element.attr("title",this.originalTitle);return this},widget:function(){return this.uiDialog},close:function(g){var i=this,e,h;if(false!==i._trigger("beforeClose",g)){i.overlay&&i.overlay.destroy();i.uiDialog.unbind("keypress.ui-dialog");i._isOpen=false;if(i.options.hide)i.uiDialog.hide(i.options.hide,function(){i._trigger("close",g)});else{i.uiDialog.hide();i._trigger("close",g)}a.ui.dialog.overlay.resize();if(i.options.modal){e=0;a(".ui-dialog").each(function(){if(this!==
95 i.uiDialog[0]){h=a(this).css("z-index");isNaN(h)||(e=Math.max(e,h))}});a.ui.dialog.maxZ=e}return i}},isOpen:function(){return this._isOpen},moveToTop:function(g,i){var e=this.options;if(e.modal&&!g||!e.stack&&!e.modal)return this._trigger("focus",i);if(e.zIndex>a.ui.dialog.maxZ)a.ui.dialog.maxZ=e.zIndex;if(this.overlay){a.ui.dialog.maxZ+=1;this.overlay.$el.css("z-index",a.ui.dialog.overlay.maxZ=a.ui.dialog.maxZ)}g={scrollTop:this.element.scrollTop(),scrollLeft:this.element.scrollLeft()};a.ui.dialog.maxZ+=
96 1;this.uiDialog.css("z-index",a.ui.dialog.maxZ);this.element.attr(g);this._trigger("focus",i);return this},open:function(){if(!this._isOpen){var g=this.options,i=this.uiDialog;this.overlay=g.modal?new a.ui.dialog.overlay(this):null;this._size();this._position(g.position);i.show(g.show);this.moveToTop(true);g.modal&&i.bind("keydown.ui-dialog",function(e){if(e.keyCode===a.ui.keyCode.TAB){var h=a(":tabbable",this),j=h.filter(":first");h=h.filter(":last");if(e.target===h[0]&&!e.shiftKey){j.focus(1);return false}else if(e.target===
97 j[0]&&e.shiftKey){h.focus(1);return false}}});a(this.element.find(":tabbable").get().concat(i.find(".ui-dialog-buttonpane :tabbable").get().concat(i.get()))).eq(0).focus();this._isOpen=true;this._trigger("open");return this}},_createButtons:function(g){var i=this,e=false,h=a("<div></div>").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),j=a("<div></div>").addClass("ui-dialog-buttonset").appendTo(h);i.uiDialog.find(".ui-dialog-buttonpane").remove();typeof g==="object"&&g!==null&&
98 a.each(g,function(){return!(e=true)});if(e){a.each(g,function(k,l){l=a.isFunction(l)?{click:l,text:k}:l;var n=a('<button type="button"></button>').click(function(){l.click.apply(i.element[0],arguments)}).appendTo(j);a.each(l,function(s,r){if(s!=="click")s in f?n[s](r):n.attr(s,r)});a.fn.button&&n.button()});h.appendTo(i.uiDialog)}},_makeDraggable:function(){function g(k){return{position:k.position,offset:k.offset}}var i=this,e=i.options,h=a(document),j;i.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",
99 handle:".ui-dialog-titlebar",containment:"document",start:function(k,l){j=e.height==="auto"?"auto":a(this).height();a(this).height(a(this).height()).addClass("ui-dialog-dragging");i._trigger("dragStart",k,g(l))},drag:function(k,l){i._trigger("drag",k,g(l))},stop:function(k,l){e.position=[l.position.left-h.scrollLeft(),l.position.top-h.scrollTop()];a(this).removeClass("ui-dialog-dragging").height(j);i._trigger("dragStop",k,g(l));a.ui.dialog.overlay.resize()}})},_makeResizable:function(g){function i(k){return{originalPosition:k.originalPosition,
100 originalSize:k.originalSize,position:k.position,size:k.size}}g=g===b?this.options.resizable:g;var e=this,h=e.options,j=e.uiDialog.css("position");g=typeof g==="string"?g:"n,e,s,w,se,sw,ne,nw";e.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:e.element,maxWidth:h.maxWidth,maxHeight:h.maxHeight,minWidth:h.minWidth,minHeight:e._minHeight(),handles:g,start:function(k,l){a(this).addClass("ui-dialog-resizing");e._trigger("resizeStart",k,i(l))},resize:function(k,l){e._trigger("resize",
101 k,i(l))},stop:function(k,l){a(this).removeClass("ui-dialog-resizing");h.height=a(this).height();h.width=a(this).width();e._trigger("resizeStop",k,i(l));a.ui.dialog.overlay.resize()}}).css("position",j).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var g=this.options;return g.height==="auto"?g.minHeight:Math.min(g.minHeight,g.height)},_position:function(g){var i=[],e=[0,0],h;if(g){if(typeof g==="string"||typeof g==="object"&&"0"in g){i=g.split?g.split(" "):
102 [g[0],g[1]];if(i.length===1)i[1]=i[0];a.each(["left","top"],function(j,k){if(+i[j]===i[j]){e[j]=i[j];i[j]=k}});g={my:i.join(" "),at:i.join(" "),offset:e.join(" ")}}g=a.extend({},a.ui.dialog.prototype.options.position,g)}else g=a.ui.dialog.prototype.options.position;(h=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(a.extend({of:window},g));h||this.uiDialog.hide()},_setOptions:function(g){var i=this,e={},h=false;a.each(g,function(j,k){i._setOption(j,k);
103 if(j in c)h=true;if(j in d)e[j]=k});h&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",e)},_setOption:function(g,i){var e=this.uiDialog;switch(g){case "beforeclose":g="beforeClose";break;case "buttons":this._createButtons(i);break;case "closeText":this.uiDialogTitlebarCloseText.text(""+i);break;case "dialogClass":e.removeClass(this.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+i);break;case "disabled":i?e.addClass("ui-dialog-disabled"):
104 e.removeClass("ui-dialog-disabled");break;case "draggable":var h=e.is(":data(draggable)");h&&!i&&e.draggable("destroy");!h&&i&&this._makeDraggable();break;case "position":this._position(i);break;case "resizable":(h=e.is(":data(resizable)"))&&!i&&e.resizable("destroy");h&&typeof i==="string"&&e.resizable("option","handles",i);!h&&i!==false&&this._makeResizable(i);break;case "title":a(".ui-dialog-title",this.uiDialogTitlebar).html(""+(i||"&#160;"));break}a.Widget.prototype._setOption.apply(this,arguments)},
105 _size:function(){var g=this.options,i,e,h=this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(g.minWidth>g.width)g.width=g.minWidth;i=this.uiDialog.css({height:"auto",width:g.width}).height();e=Math.max(0,g.minHeight-i);if(g.height==="auto")if(a.support.minHeight)this.element.css({minHeight:e,height:"auto"});else{this.uiDialog.show();g=this.element.css("height","auto").height();h||this.uiDialog.hide();this.element.height(Math.max(g,e))}else this.element.height(Math.max(g.height-
106 i,0));this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option","minHeight",this._minHeight())}});a.extend(a.ui.dialog,{version:"1.8.17",uuid:0,maxZ:0,getTitleId:function(g){g=g.attr("id");if(!g){this.uuid+=1;g=this.uuid}return"ui-dialog-title-"+g},overlay:function(g){this.$el=a.ui.dialog.overlay.create(g)}});a.extend(a.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:a.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(g){return g+".dialog-overlay"}).join(" "),
107 create:function(g){if(this.instances.length===0){setTimeout(function(){a.ui.dialog.overlay.instances.length&&a(document).bind(a.ui.dialog.overlay.events,function(e){if(a(e.target).zIndex()<a.ui.dialog.overlay.maxZ)return false})},1);a(document).bind("keydown.dialog-overlay",function(e){if(g.options.closeOnEscape&&!e.isDefaultPrevented()&&e.keyCode&&e.keyCode===a.ui.keyCode.ESCAPE){g.close(e);e.preventDefault()}});a(window).bind("resize.dialog-overlay",a.ui.dialog.overlay.resize)}var i=(this.oldInstances.pop()||
108 a("<div></div>").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(),height:this.height()});a.fn.bgiframe&&i.bgiframe();this.instances.push(i);return i},destroy:function(g){var i=a.inArray(g,this.instances);i!=-1&&this.oldInstances.push(this.instances.splice(i,1)[0]);this.instances.length===0&&a([document,window]).unbind(".dialog-overlay");g.remove();var e=0;a.each(this.instances,function(){e=Math.max(e,this.css("z-index"))});this.maxZ=e},height:function(){var g,i;if(a.browser.msie&&
109 a.browser.version<7){g=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);i=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return g<i?a(window).height()+"px":g+"px"}else return a(document).height()+"px"},width:function(){var g,i;if(a.browser.msie){g=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);i=Math.max(document.documentElement.offsetWidth,document.body.offsetWidth);return g<i?a(window).width()+"px":g+"px"}else return a(document).width()+
110 "px"},resize:function(){var g=a([]);a.each(a.ui.dialog.overlay.instances,function(){g=g.add(this)});g.css({width:0,height:0}).css({width:a.ui.dialog.overlay.width(),height:a.ui.dialog.overlay.height()})}});a.extend(a.ui.dialog.overlay.prototype,{destroy:function(){a.ui.dialog.overlay.destroy(this.$el)}})})(jQuery);
111 (function(a,b){if(a.cleanData){var c=a.cleanData;a.cleanData=function(f){for(var g=0,i;(i=f[g])!=null;g++)try{a(i).triggerHandler("remove")}catch(e){}c(f)}}else{var d=a.fn.remove;a.fn.remove=function(f,g){return this.each(function(){if(!g)if(!f||a.filter(f,[this]).length)a("*",this).add([this]).each(function(){try{a(this).triggerHandler("remove")}catch(i){}});return d.call(a(this),f,g)})}}a.widget=function(f,g,i){var e=f.split(".")[0],h;f=f.split(".")[1];h=e+"-"+f;if(!i){i=g;g=a.Widget}a.expr[":"][h]=
112 function(j){return!!a.data(j,f)};a[e]=a[e]||{};a[e][f]=function(j,k){arguments.length&&this._createWidget(j,k)};g=new g;g.options=a.extend(true,{},g.options);a[e][f].prototype=a.extend(true,g,{namespace:e,widgetName:f,widgetEventPrefix:a[e][f].prototype.widgetEventPrefix||f,widgetBaseClass:h},i);a.widget.bridge(f,a[e][f])};a.widget.bridge=function(f,g){a.fn[f]=function(i){var e=typeof i==="string",h=Array.prototype.slice.call(arguments,1),j=this;i=!e&&h.length?a.extend.apply(null,[true,i].concat(h)):
113 i;if(e&&i.charAt(0)==="_")return j;e?this.each(function(){var k=a.data(this,f),l=k&&a.isFunction(k[i])?k[i].apply(k,h):k;if(l!==k&&l!==b){j=l;return false}}):this.each(function(){var k=a.data(this,f);k?k.option(i||{})._init():a.data(this,f,new g(i,this))});return j}};a.Widget=function(f,g){arguments.length&&this._createWidget(f,g)};a.Widget.prototype={widgetName:"widget",widgetEventPrefix:"",options:{disabled:false},_createWidget:function(f,g){a.data(g,this.widgetName,this);this.element=a(g);this.options=
114 a.extend(true,{},this.options,this._getCreateOptions(),f);var i=this;this.element.bind("remove."+this.widgetName,function(){i.destroy()});this._create();this._trigger("create");this._init()},_getCreateOptions:function(){return a.metadata&&a.metadata.get(this.element[0])[this.widgetName]},_create:function(){},_init:function(){},destroy:function(){this.element.unbind("."+this.widgetName).removeData(this.widgetName);this.widget().unbind("."+this.widgetName).removeAttr("aria-disabled").removeClass(this.widgetBaseClass+
115 "-disabled ui-state-disabled")},widget:function(){return this.element},option:function(f,g){var i=f;if(arguments.length===0)return a.extend({},this.options);if(typeof f==="string"){if(g===b)return this.options[f];i={};i[f]=g}this._setOptions(i);return this},_setOptions:function(f){var g=this;a.each(f,function(i,e){g._setOption(i,e)});return this},_setOption:function(f,g){this.options[f]=g;if(f==="disabled")this.widget()[g?"addClass":"removeClass"](this.widgetBaseClass+"-disabled ui-state-disabled").attr("aria-disabled",
116 g);return this},enable:function(){return this._setOption("disabled",false)},disable:function(){return this._setOption("disabled",true)},_trigger:function(f,g,i){var e,h=this.options[f];i=i||{};g=a.Event(g);g.type=(f===this.widgetEventPrefix?f:this.widgetEventPrefix+f).toLowerCase();g.target=this.element[0];if(f=g.originalEvent)for(e in f)e in g||(g[e]=f[e]);this.element.trigger(g,i);return!(a.isFunction(h)&&h.call(this.element[0],g,i)===false||g.isDefaultPrevented())}}})(jQuery);
117 (function(a){var b=false;a(document).mouseup(function(){b=false});a.widget("ui.mouse",{options:{cancel:":input,option",distance:1,delay:0},_mouseInit:function(){var c=this;this.element.bind("mousedown."+this.widgetName,function(d){return c._mouseDown(d)}).bind("click."+this.widgetName,function(d){if(true===a.data(d.target,c.widgetName+".preventClickEvent")){a.removeData(d.target,c.widgetName+".preventClickEvent");d.stopImmediatePropagation();return false}});this.started=false},_mouseDestroy:function(){this.element.unbind("."+
118 this.widgetName)},_mouseDown:function(c){if(!b){this._mouseStarted&&this._mouseUp(c);this._mouseDownEvent=c;var d=this,f=c.which==1,g=typeof this.options.cancel=="string"&&c.target.nodeName?a(c.target).closest(this.options.cancel).length:false;if(!f||g||!this._mouseCapture(c))return true;this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet)this._mouseDelayTimer=setTimeout(function(){d.mouseDelayMet=true},this.options.delay);if(this._mouseDistanceMet(c)&&this._mouseDelayMet(c)){this._mouseStarted=
119 this._mouseStart(c)!==false;if(!this._mouseStarted){c.preventDefault();return true}}true===a.data(c.target,this.widgetName+".preventClickEvent")&&a.removeData(c.target,this.widgetName+".preventClickEvent");this._mouseMoveDelegate=function(i){return d._mouseMove(i)};this._mouseUpDelegate=function(i){return d._mouseUp(i)};a(document).bind("mousemove."+this.widgetName,this._mouseMoveDelegate).bind("mouseup."+this.widgetName,this._mouseUpDelegate);c.preventDefault();return b=true}},_mouseMove:function(c){if(a.browser.msie&&
120 !(document.documentMode>=9)&&!c.button)return this._mouseUp(c);if(this._mouseStarted){this._mouseDrag(c);return c.preventDefault()}if(this._mouseDistanceMet(c)&&this._mouseDelayMet(c))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,c)!==false)?this._mouseDrag(c):this._mouseUp(c);return!this._mouseStarted},_mouseUp:function(c){a(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=
121 false;c.target==this._mouseDownEvent.target&&a.data(c.target,this.widgetName+".preventClickEvent",true);this._mouseStop(c)}return false},_mouseDistanceMet:function(c){return Math.max(Math.abs(this._mouseDownEvent.pageX-c.pageX),Math.abs(this._mouseDownEvent.pageY-c.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery);
122 (function(a){a.widget("ui.draggable",a.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper==
123 "original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(b){var c=
124 this.options;if(this.helper||c.disabled||a(b.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(b);if(!this.handle)return false;if(c.iframeFix)a(c.iframeFix===true?"iframe":c.iframeFix).each(function(){a('<div class="ui-draggable-iframeFix" style="background: #fff;"></div>').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(a(this).offset()).appendTo("body")});return true},_mouseStart:function(b){var c=this.options;
125 this.helper=this._createHelper(b);this._cacheHelperProportions();if(a.ui.ddmanager)a.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});
126 this.originalPosition=this.position=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt);c.containment&&this._setContainment();if(this._trigger("start",b)===false){this._clear();return false}this._cacheHelperProportions();a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(b,true);a.ui.ddmanager&&a.ui.ddmanager.dragStart(this,b);return true},
127 _mouseDrag:function(b,c){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!c){c=this._uiHash();if(this._trigger("drag",b,c)===false){this._mouseUp({});return false}this.position=c.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);return false},_mouseStop:function(b){var c=
128 false;if(a.ui.ddmanager&&!this.options.dropBehaviour)c=a.ui.ddmanager.drop(this,b);if(this.dropped){c=this.dropped;this.dropped=false}if((!this.element[0]||!this.element[0].parentNode)&&this.options.helper=="original")return false;if(this.options.revert=="invalid"&&!c||this.options.revert=="valid"&&c||this.options.revert===true||a.isFunction(this.options.revert)&&this.options.revert.call(this.element,c)){var d=this;a(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,
129 10),function(){d._trigger("stop",b)!==false&&d._clear()})}else this._trigger("stop",b)!==false&&this._clear();return false},_mouseUp:function(b){this.options.iframeFix===true&&a("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)});a.ui.ddmanager&&a.ui.ddmanager.dragStop(this,b);return a.ui.mouse.prototype._mouseUp.call(this,b)},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(b){var c=!this.options.handle||
130 !a(this.options.handle,this.element).length?true:false;a(this.options.handle,this.element).find("*").andSelf().each(function(){if(this==b.target)c=true});return c},_createHelper:function(b){var c=this.options;b=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b])):c.helper=="clone"?this.element.clone().removeAttr("id"):this.element;b.parents("body").length||b.appendTo(c.appendTo=="parent"?this.element[0].parentNode:c.appendTo);b[0]!=this.element[0]&&!/(fixed|absolute)/.test(b.css("position"))&&
131 b.css("position","absolute");return b},_adjustOffsetFromHelper:function(b){if(typeof b=="string")b=b.split(" ");if(a.isArray(b))b={left:+b[0],top:+b[1]||0};if("left"in b)this.offset.click.left=b.left+this.margins.left;if("right"in b)this.offset.click.left=this.helperProportions.width-b.right+this.margins.left;if("top"in b)this.offset.click.top=b.top+this.margins.top;if("bottom"in b)this.offset.click.top=this.helperProportions.height-b.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=
132 this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b={top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),
133 10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.element.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0,right:parseInt(this.element.css("marginRight"),10)||0,bottom:parseInt(this.element.css("marginBottom"),
134 10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;if(b.containment=="parent")b.containment=this.helper[0].parentNode;if(b.containment=="document"||b.containment=="window")this.containment=[b.containment=="document"?0:a(window).scrollLeft()-this.offset.relative.left-this.offset.parent.left,b.containment=="document"?0:a(window).scrollTop()-this.offset.relative.top-this.offset.parent.top,
135 (b.containment=="document"?0:a(window).scrollLeft())+a(b.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(b.containment=="document"?0:a(window).scrollTop())+(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)&&b.containment.constructor!=Array){b=a(b.containment);var c=b[0];if(c){b.offset();var d=a(c).css("overflow")!=
136 "hidden";this.containment=[(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0),(parseInt(a(c).css("borderTopWidth"),10)||0)+(parseInt(a(c).css("paddingTop"),10)||0),(d?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left-this.margins.right,(d?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),
137 10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top-this.margins.bottom];this.relative_container=b}}else if(b.containment.constructor==Array)this.containment=b.containment},_convertPositionTo:function(b,c){if(!c)c=this.position;b=b=="absolute"?1:-1;var d=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(d[0].tagName);return{top:c.top+
138 this.offset.relative.top*b+this.offset.parent.top*b-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:d.scrollTop())*b),left:c.left+this.offset.relative.left*b+this.offset.parent.left*b-(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:d.scrollLeft())*b)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&
139 !(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(d[0].tagName),g=b.pageX,i=b.pageY;if(this.originalPosition){var e;if(this.containment){if(this.relative_container){e=this.relative_container.offset();e=[this.containment[0]+e.left,this.containment[1]+e.top,this.containment[2]+e.left,this.containment[3]+e.top]}else e=this.containment;if(b.pageX-this.offset.click.left<e[0])g=e[0]+this.offset.click.left;
140 if(b.pageY-this.offset.click.top<e[1])i=e[1]+this.offset.click.top;if(b.pageX-this.offset.click.left>e[2])g=e[2]+this.offset.click.left;if(b.pageY-this.offset.click.top>e[3])i=e[3]+this.offset.click.top}if(c.grid){i=c.grid[1]?this.originalPageY+Math.round((i-this.originalPageY)/c.grid[1])*c.grid[1]:this.originalPageY;i=e?!(i-this.offset.click.top<e[1]||i-this.offset.click.top>e[3])?i:!(i-this.offset.click.top<e[1])?i-c.grid[1]:i+c.grid[1]:i;g=c.grid[0]?this.originalPageX+Math.round((g-this.originalPageX)/
141 c.grid[0])*c.grid[0]:this.originalPageX;g=e?!(g-this.offset.click.left<e[0]||g-this.offset.click.left>e[2])?g:!(g-this.offset.click.left<e[0])?g-c.grid[0]:g+c.grid[0]:g}}return{top:i-this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&a.browser.version<526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:d.scrollTop()),left:g-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&a.browser.version<
142 526&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:d.scrollLeft())}},_clear:function(){this.helper.removeClass("ui-draggable-dragging");this.helper[0]!=this.element[0]&&!this.cancelHelperRemoval&&this.helper.remove();this.helper=null;this.cancelHelperRemoval=false},_trigger:function(b,c,d){d=d||this._uiHash();a.ui.plugin.call(this,b,[c,d]);if(b=="drag")this.positionAbs=this._convertPositionTo("absolute");return a.Widget.prototype._trigger.call(this,b,c,
143 d)},plugins:{},_uiHash:function(){return{helper:this.helper,position:this.position,originalPosition:this.originalPosition,offset:this.positionAbs}}});a.extend(a.ui.draggable,{version:"1.8.17"});a.ui.plugin.add("draggable","connectToSortable",{start:function(b,c){var d=a(this).data("draggable"),f=d.options,g=a.extend({},c,{item:d.element});d.sortables=[];a(f.connectToSortable).each(function(){var i=a.data(this,"sortable");if(i&&!i.options.disabled){d.sortables.push({instance:i,shouldRevert:i.options.revert});
144 i.refreshPositions();i._trigger("activate",b,g)}})},stop:function(b,c){var d=a(this).data("draggable"),f=a.extend({},c,{item:d.element});a.each(d.sortables,function(){if(this.instance.isOver){this.instance.isOver=0;d.cancelHelperRemoval=true;this.instance.cancelHelperRemoval=false;if(this.shouldRevert)this.instance.options.revert=true;this.instance._mouseStop(b);this.instance.options.helper=this.instance.options._helper;d.options.helper=="original"&&this.instance.currentItem.css({top:"auto",left:"auto"})}else{this.instance.cancelHelperRemoval=
145 false;this.instance._trigger("deactivate",b,f)}})},drag:function(b,c){var d=a(this).data("draggable"),f=this;a.each(d.sortables,function(){this.instance.positionAbs=d.positionAbs;this.instance.helperProportions=d.helperProportions;this.instance.offset.click=d.offset.click;if(this.instance._intersectsWith(this.instance.containerCache)){if(!this.instance.isOver){this.instance.isOver=1;this.instance.currentItem=a(f).clone().removeAttr("id").appendTo(this.instance.element).data("sortable-item",true);
146 this.instance.options._helper=this.instance.options.helper;this.instance.options.helper=function(){return c.helper[0]};b.target=this.instance.currentItem[0];this.instance._mouseCapture(b,true);this.instance._mouseStart(b,true,true);this.instance.offset.click.top=d.offset.click.top;this.instance.offset.click.left=d.offset.click.left;this.instance.offset.parent.left-=d.offset.parent.left-this.instance.offset.parent.left;this.instance.offset.parent.top-=d.offset.parent.top-this.instance.offset.parent.top;
147 d._trigger("toSortable",b);d.dropped=this.instance.element;d.currentItem=d.element;this.instance.fromOutside=d}this.instance.currentItem&&this.instance._mouseDrag(b)}else if(this.instance.isOver){this.instance.isOver=0;this.instance.cancelHelperRemoval=true;this.instance.options.revert=false;this.instance._trigger("out",b,this.instance._uiHash(this.instance));this.instance._mouseStop(b,true);this.instance.options.helper=this.instance.options._helper;this.instance.currentItem.remove();this.instance.placeholder&&
148 this.instance.placeholder.remove();d._trigger("fromSortable",b);d.dropped=false}})}});a.ui.plugin.add("draggable","cursor",{start:function(){var b=a("body"),c=a(this).data("draggable").options;if(b.css("cursor"))c._cursor=b.css("cursor");b.css("cursor",c.cursor)},stop:function(){var b=a(this).data("draggable").options;b._cursor&&a("body").css("cursor",b._cursor)}});a.ui.plugin.add("draggable","opacity",{start:function(b,c){b=a(c.helper);c=a(this).data("draggable").options;if(b.css("opacity"))c._opacity=
149 b.css("opacity");b.css("opacity",c.opacity)},stop:function(b,c){b=a(this).data("draggable").options;b._opacity&&a(c.helper).css("opacity",b._opacity)}});a.ui.plugin.add("draggable","scroll",{start:function(){var b=a(this).data("draggable");if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML")b.overflowOffset=b.scrollParent.offset()},drag:function(b){var c=a(this).data("draggable"),d=c.options,f=false;if(c.scrollParent[0]!=document&&c.scrollParent[0].tagName!="HTML"){if(!d.axis||d.axis!=
150 "x")if(c.overflowOffset.top+c.scrollParent[0].offsetHeight-b.pageY<d.scrollSensitivity)c.scrollParent[0].scrollTop=f=c.scrollParent[0].scrollTop+d.scrollSpeed;else if(b.pageY-c.overflowOffset.top<d.scrollSensitivity)c.scrollParent[0].scrollTop=f=c.scrollParent[0].scrollTop-d.scrollSpeed;if(!d.axis||d.axis!="y")if(c.overflowOffset.left+c.scrollParent[0].offsetWidth-b.pageX<d.scrollSensitivity)c.scrollParent[0].scrollLeft=f=c.scrollParent[0].scrollLeft+d.scrollSpeed;else if(b.pageX-c.overflowOffset.left<
151 d.scrollSensitivity)c.scrollParent[0].scrollLeft=f=c.scrollParent[0].scrollLeft-d.scrollSpeed}else{if(!d.axis||d.axis!="x")if(b.pageY-a(document).scrollTop()<d.scrollSensitivity)f=a(document).scrollTop(a(document).scrollTop()-d.scrollSpeed);else if(a(window).height()-(b.pageY-a(document).scrollTop())<d.scrollSensitivity)f=a(document).scrollTop(a(document).scrollTop()+d.scrollSpeed);if(!d.axis||d.axis!="y")if(b.pageX-a(document).scrollLeft()<d.scrollSensitivity)f=a(document).scrollLeft(a(document).scrollLeft()-
152 d.scrollSpeed);else if(a(window).width()-(b.pageX-a(document).scrollLeft())<d.scrollSensitivity)f=a(document).scrollLeft(a(document).scrollLeft()+d.scrollSpeed)}f!==false&&a.ui.ddmanager&&!d.dropBehaviour&&a.ui.ddmanager.prepareOffsets(c,b)}});a.ui.plugin.add("draggable","snap",{start:function(){var b=a(this).data("draggable"),c=b.options;b.snapElements=[];a(c.snap.constructor!=String?c.snap.items||":data(draggable)":c.snap).each(function(){var d=a(this),f=d.offset();this!=b.element[0]&&b.snapElements.push({item:this,
153 width:d.outerWidth(),height:d.outerHeight(),top:f.top,left:f.left})})},drag:function(b,c){for(var d=a(this).data("draggable"),f=d.options,g=f.snapTolerance,i=c.offset.left,e=i+d.helperProportions.width,h=c.offset.top,j=h+d.helperProportions.height,k=d.snapElements.length-1;k>=0;k--){var l=d.snapElements[k].left,n=l+d.snapElements[k].width,s=d.snapElements[k].top,r=s+d.snapElements[k].height;if(l-g<i&&i<n+g&&s-g<h&&h<r+g||l-g<i&&i<n+g&&s-g<j&&j<r+g||l-g<e&&e<n+g&&s-g<h&&h<r+g||l-g<e&&e<n+g&&s-g<j&&
154 j<r+g){if(f.snapMode!="inner"){var v=Math.abs(s-j)<=g,o=Math.abs(r-h)<=g,q=Math.abs(l-e)<=g,m=Math.abs(n-i)<=g;if(v)c.position.top=d._convertPositionTo("relative",{top:s-d.helperProportions.height,left:0}).top-d.margins.top;if(o)c.position.top=d._convertPositionTo("relative",{top:r,left:0}).top-d.margins.top;if(q)c.position.left=d._convertPositionTo("relative",{top:0,left:l-d.helperProportions.width}).left-d.margins.left;if(m)c.position.left=d._convertPositionTo("relative",{top:0,left:n}).left-d.margins.left}var p=
155 v||o||q||m;if(f.snapMode!="outer"){v=Math.abs(s-h)<=g;o=Math.abs(r-j)<=g;q=Math.abs(l-i)<=g;m=Math.abs(n-e)<=g;if(v)c.position.top=d._convertPositionTo("relative",{top:s,left:0}).top-d.margins.top;if(o)c.position.top=d._convertPositionTo("relative",{top:r-d.helperProportions.height,left:0}).top-d.margins.top;if(q)c.position.left=d._convertPositionTo("relative",{top:0,left:l}).left-d.margins.left;if(m)c.position.left=d._convertPositionTo("relative",{top:0,left:n-d.helperProportions.width}).left-d.margins.left}if(!d.snapElements[k].snapping&&
156 (v||o||q||m||p))d.options.snap.snap&&d.options.snap.snap.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item}));d.snapElements[k].snapping=v||o||q||m||p}else{d.snapElements[k].snapping&&d.options.snap.release&&d.options.snap.release.call(d.element,b,a.extend(d._uiHash(),{snapItem:d.snapElements[k].item}));d.snapElements[k].snapping=false}}}});a.ui.plugin.add("draggable","stack",{start:function(){var b=a(this).data("draggable").options;b=a.makeArray(a(b.stack)).sort(function(d,f){return(parseInt(a(d).css("zIndex"),
157 10)||0)-(parseInt(a(f).css("zIndex"),10)||0)});if(b.length){var c=parseInt(b[0].style.zIndex)||0;a(b).each(function(d){this.style.zIndex=c+d});this[0].style.zIndex=c+b.length}}});a.ui.plugin.add("draggable","zIndex",{start:function(b,c){b=a(c.helper);c=a(this).data("draggable").options;if(b.css("zIndex"))c._zIndex=b.css("zIndex");b.css("zIndex",c.zIndex)},stop:function(b,c){b=a(this).data("draggable").options;b._zIndex&&a(c.helper).css("zIndex",b._zIndex)}})})(jQuery);
158 (function(a){a.widget("ui.droppable",{widgetEventPrefix:"drop",options:{accept:"*",activeClass:false,addClasses:true,greedy:false,hoverClass:false,scope:"default",tolerance:"intersect"},_create:function(){var b=this.options,c=b.accept;this.isover=0;this.isout=1;this.accept=a.isFunction(c)?c:function(d){return d.is(c)};this.proportions={width:this.element[0].offsetWidth,height:this.element[0].offsetHeight};a.ui.ddmanager.droppables[b.scope]=a.ui.ddmanager.droppables[b.scope]||[];a.ui.ddmanager.droppables[b.scope].push(this);
159 b.addClasses&&this.element.addClass("ui-droppable")},destroy:function(){for(var b=a.ui.ddmanager.droppables[this.options.scope],c=0;c<b.length;c++)b[c]==this&&b.splice(c,1);this.element.removeClass("ui-droppable ui-droppable-disabled").removeData("droppable").unbind(".droppable");return this},_setOption:function(b,c){if(b=="accept")this.accept=a.isFunction(c)?c:function(d){return d.is(c)};a.Widget.prototype._setOption.apply(this,arguments)},_activate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&
160 this.element.addClass(this.options.activeClass);c&&this._trigger("activate",b,this.ui(c))},_deactivate:function(b){var c=a.ui.ddmanager.current;this.options.activeClass&&this.element.removeClass(this.options.activeClass);c&&this._trigger("deactivate",b,this.ui(c))},_over:function(b){var c=a.ui.ddmanager.current;if(!(!c||(c.currentItem||c.element)[0]==this.element[0]))if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.hoverClass&&this.element.addClass(this.options.hoverClass);
161 this._trigger("over",b,this.ui(c))}},_out:function(b){var c=a.ui.ddmanager.current;if(!(!c||(c.currentItem||c.element)[0]==this.element[0]))if(this.accept.call(this.element[0],c.currentItem||c.element)){this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("out",b,this.ui(c))}},_drop:function(b,c){var d=c||a.ui.ddmanager.current;if(!d||(d.currentItem||d.element)[0]==this.element[0])return false;var f=false;this.element.find(":data(droppable)").not(".ui-draggable-dragging").each(function(){var g=
162 a.data(this,"droppable");if(g.options.greedy&&!g.options.disabled&&g.options.scope==d.options.scope&&g.accept.call(g.element[0],d.currentItem||d.element)&&a.ui.intersect(d,a.extend(g,{offset:g.element.offset()}),g.options.tolerance)){f=true;return false}});if(f)return false;if(this.accept.call(this.element[0],d.currentItem||d.element)){this.options.activeClass&&this.element.removeClass(this.options.activeClass);this.options.hoverClass&&this.element.removeClass(this.options.hoverClass);this._trigger("drop",
163 b,this.ui(d));return this.element}return false},ui:function(b){return{draggable:b.currentItem||b.element,helper:b.helper,position:b.position,offset:b.positionAbs}}});a.extend(a.ui.droppable,{version:"1.8.17"});a.ui.intersect=function(b,c,d){if(!c.offset)return false;var f=(b.positionAbs||b.position.absolute).left,g=f+b.helperProportions.width,i=(b.positionAbs||b.position.absolute).top,e=i+b.helperProportions.height,h=c.offset.left,j=h+c.proportions.width,k=c.offset.top,l=k+c.proportions.height;switch(d){case "fit":return h<=
164 f&&g<=j&&k<=i&&e<=l;case "intersect":return h<f+b.helperProportions.width/2&&g-b.helperProportions.width/2<j&&k<i+b.helperProportions.height/2&&e-b.helperProportions.height/2<l;case "pointer":return a.ui.isOver((b.positionAbs||b.position.absolute).top+(b.clickOffset||b.offset.click).top,(b.positionAbs||b.position.absolute).left+(b.clickOffset||b.offset.click).left,k,h,c.proportions.height,c.proportions.width);case "touch":return(i>=k&&i<=l||e>=k&&e<=l||i<k&&e>l)&&(f>=h&&f<=j||g>=h&&g<=j||f<h&&g>j);
165 default:return false}};a.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(b,c){var d=a.ui.ddmanager.droppables[b.options.scope]||[],f=c?c.type:null,g=(b.currentItem||b.element).find(":data(droppable)").andSelf(),i=0;a:for(;i<d.length;i++)if(!(d[i].options.disabled||b&&!d[i].accept.call(d[i].element[0],b.currentItem||b.element))){for(var e=0;e<g.length;e++)if(g[e]==d[i].element[0]){d[i].proportions.height=0;continue a}d[i].visible=d[i].element.css("display")!="none";if(d[i].visible){f==
166 "mousedown"&&d[i]._activate.call(d[i],c);d[i].offset=d[i].element.offset();d[i].proportions={width:d[i].element[0].offsetWidth,height:d[i].element[0].offsetHeight}}}},drop:function(b,c){var d=false;a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(this.options){if(!this.options.disabled&&this.visible&&a.ui.intersect(b,this,this.options.tolerance))d=this._drop.call(this,c)||d;if(!this.options.disabled&&this.visible&&this.accept.call(this.element[0],b.currentItem||b.element)){this.isout=
167 1;this.isover=0;this._deactivate.call(this,c)}}});return d},dragStart:function(b,c){b.element.parents(":not(body,html)").bind("scroll.droppable",function(){b.options.refreshPositions||a.ui.ddmanager.prepareOffsets(b,c)})},drag:function(b,c){b.options.refreshPositions&&a.ui.ddmanager.prepareOffsets(b,c);a.each(a.ui.ddmanager.droppables[b.options.scope]||[],function(){if(!(this.options.disabled||this.greedyChild||!this.visible)){var d=a.ui.intersect(b,this,this.options.tolerance);if(d=!d&&this.isover==
168 1?"isout":d&&this.isover==0?"isover":null){var f;if(this.options.greedy){var g=this.element.parents(":data(droppable):eq(0)");if(g.length){f=a.data(g[0],"droppable");f.greedyChild=d=="isover"?1:0}}if(f&&d=="isover"){f.isover=0;f.isout=1;f._out.call(f,c)}this[d]=1;this[d=="isout"?"isover":"isout"]=0;this[d=="isover"?"_over":"_out"].call(this,c);if(f&&d=="isout"){f.isout=0;f.isover=1;f._over.call(f,c)}}}})},dragStop:function(b,c){b.element.parents(":not(body,html)").unbind("scroll.droppable");b.options.refreshPositions||
169 a.ui.ddmanager.prepareOffsets(b,c)}}})(jQuery);
170 (function(a,b){function c(f,g){var i=f.nodeName.toLowerCase();if("area"===i){g=f.parentNode;i=g.name;if(!f.href||!i||g.nodeName.toLowerCase()!=="map")return false;f=a("img[usemap=#"+i+"]")[0];return!!f&&d(f)}return(/input|select|textarea|button|object/.test(i)?!f.disabled:"a"==i?f.href||g:g)&&d(f)}function d(f){return!a(f).parents().andSelf().filter(function(){return a.curCSS(this,"visibility")==="hidden"||a.expr.filters.hidden(this)}).length}a.ui=a.ui||{};if(!a.ui.version){a.extend(a.ui,{version:"1.8.17",
171 keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106,NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});a.fn.extend({propAttr:a.fn.prop||a.fn.attr,_focus:a.fn.focus,focus:function(f,g){return typeof f==="number"?this.each(function(){var i=
172 this;setTimeout(function(){a(i).focus();g&&g.call(i)},f)}):this._focus.apply(this,arguments)},scrollParent:function(){var f;f=a.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(a.curCSS(this,"position",1))&&/(auto|scroll)/.test(a.curCSS(this,"overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(a.curCSS(this,
173 "overflow",1)+a.curCSS(this,"overflow-y",1)+a.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!f.length?a(document):f},zIndex:function(f){if(f!==b)return this.css("zIndex",f);if(this.length){f=a(this[0]);for(var g;f.length&&f[0]!==document;){g=f.css("position");if(g==="absolute"||g==="relative"||g==="fixed"){g=parseInt(f.css("zIndex"),10);if(!isNaN(g)&&g!==0)return g}f=f.parent()}}return 0},disableSelection:function(){return this.bind((a.support.selectstart?"selectstart":
174 "mousedown")+".ui-disableSelection",function(f){f.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});a.each(["Width","Height"],function(f,g){function i(k,l,n,s){a.each(e,function(){l-=parseFloat(a.curCSS(k,"padding"+this,true))||0;if(n)l-=parseFloat(a.curCSS(k,"border"+this+"Width",true))||0;if(s)l-=parseFloat(a.curCSS(k,"margin"+this,true))||0});return l}var e=g==="Width"?["Left","Right"]:["Top","Bottom"],h=g.toLowerCase(),j={innerWidth:a.fn.innerWidth,innerHeight:a.fn.innerHeight,
175 outerWidth:a.fn.outerWidth,outerHeight:a.fn.outerHeight};a.fn["inner"+g]=function(k){if(k===b)return j["inner"+g].call(this);return this.each(function(){a(this).css(h,i(this,k)+"px")})};a.fn["outer"+g]=function(k,l){if(typeof k!=="number")return j["outer"+g].call(this,k);return this.each(function(){a(this).css(h,i(this,k,true,l)+"px")})}});a.extend(a.expr[":"],{data:function(f,g,i){return!!a.data(f,i[3])},focusable:function(f){return c(f,!isNaN(a.attr(f,"tabindex")))},tabbable:function(f){var g=a.attr(f,
176 "tabindex"),i=isNaN(g);return(i||g>=0)&&c(f,!i)}});a(function(){var f=document.body,g=f.appendChild(g=document.createElement("div"));a.extend(g.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});a.support.minHeight=g.offsetHeight===100;a.support.selectstart="onselectstart"in g;f.removeChild(g).style.display="none"});a.extend(a.ui,{plugin:{add:function(f,g,i){f=a.ui[f].prototype;for(var e in i){f.plugins[e]=f.plugins[e]||[];f.plugins[e].push([g,i[e]])}},call:function(f,g,i){if((g=f.plugins[g])&&
177 f.element[0].parentNode)for(var e=0;e<g.length;e++)f.options[g[e][0]]&&g[e][1].apply(f.element,i)}},contains:function(f,g){return document.compareDocumentPosition?f.compareDocumentPosition(g)&16:f!==g&&f.contains(g)},hasScroll:function(f,g){if(a(f).css("overflow")==="hidden")return false;g=g&&g==="left"?"scrollLeft":"scrollTop";var i=false;if(f[g]>0)return true;f[g]=1;i=f[g]>0;f[g]=0;return i},isOverAxis:function(f,g,i){return f>g&&f<g+i},isOver:function(f,g,i,e,h,j){return a.ui.isOverAxis(f,i,h)&&
178 a.ui.isOverAxis(g,e,j)}})}})(jQuery);
179 (function(a){a.widget("ui.sortable",a.ui.mouse,{widgetEventPrefix:"sort",options:{appendTo:"parent",axis:false,connectWith:false,containment:false,cursor:"auto",cursorAt:false,dropOnEmpty:true,forcePlaceholderSize:false,forceHelperSize:false,grid:false,handle:false,helper:"original",items:"> *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){var b=this.options;this.containerCache={};this.element.addClass("ui-sortable");
180 this.refresh();this.floating=this.items.length?b.axis==="x"||/left|right/.test(this.items[0].item.css("float"))||/inline|table-cell/.test(this.items[0].item.css("display")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled");this._mouseDestroy();for(var b=this.items.length-1;b>=0;b--)this.items[b].item.removeData(this.widgetName+"-item");return this},_setOption:function(b,c){if(b==="disabled"){this.options[b]=c;
181 this.widget()[c?"addClass":"removeClass"]("ui-sortable-disabled")}else a.Widget.prototype._setOption.apply(this,arguments)},_mouseCapture:function(b,c){var d=this;if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(b);var f=null,g=this;a(b.target).parents().each(function(){if(a.data(this,d.widgetName+"-item")==g){f=a(this);return false}});if(a.data(b.target,d.widgetName+"-item")==g)f=a(b.target);if(!f)return false;if(this.options.handle&&
182 !c){var i=false;a(this.options.handle,f).find("*").andSelf().each(function(){if(this==b.target)i=true});if(!i)return false}this.currentItem=f;this._removeCurrentsFromItems();return true},_mouseStart:function(b,c,d){c=this.options;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(b);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-
183 this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");a.extend(this.offset,{click:{left:b.pageX-this.offset.left,top:b.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(b);this.originalPageX=b.pageX;this.originalPageY=b.pageY;c.cursorAt&&this._adjustOffsetFromHelper(c.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};
184 this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();c.containment&&this._setContainment();if(c.cursor){if(a("body").css("cursor"))this._storedCursor=a("body").css("cursor");a("body").css("cursor",c.cursor)}if(c.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",c.opacity)}if(c.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",c.zIndex)}if(this.scrollParent[0]!=
185 document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start",b,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!d)for(d=this.containers.length-1;d>=0;d--)this.containers[d]._trigger("activate",b,this._uiHash(this));if(a.ui.ddmanager)a.ui.ddmanager.current=this;a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,b);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(b);
186 return true},_mouseDrag:function(b){this.position=this._generatePosition(b);this.positionAbs=this._convertPositionTo("absolute");if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var c=this.options,d=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-b.pageY<c.scrollSensitivity)this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop+c.scrollSpeed;else if(b.pageY-this.overflowOffset.top<
187 c.scrollSensitivity)this.scrollParent[0].scrollTop=d=this.scrollParent[0].scrollTop-c.scrollSpeed;if(this.overflowOffset.left+this.scrollParent[0].offsetWidth-b.pageX<c.scrollSensitivity)this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft+c.scrollSpeed;else if(b.pageX-this.overflowOffset.left<c.scrollSensitivity)this.scrollParent[0].scrollLeft=d=this.scrollParent[0].scrollLeft-c.scrollSpeed}else{if(b.pageY-a(document).scrollTop()<c.scrollSensitivity)d=a(document).scrollTop(a(document).scrollTop()-
188 c.scrollSpeed);else if(a(window).height()-(b.pageY-a(document).scrollTop())<c.scrollSensitivity)d=a(document).scrollTop(a(document).scrollTop()+c.scrollSpeed);if(b.pageX-a(document).scrollLeft()<c.scrollSensitivity)d=a(document).scrollLeft(a(document).scrollLeft()-c.scrollSpeed);else if(a(window).width()-(b.pageX-a(document).scrollLeft())<c.scrollSensitivity)d=a(document).scrollLeft(a(document).scrollLeft()+c.scrollSpeed)}d!==false&&a.ui.ddmanager&&!c.dropBehaviour&&a.ui.ddmanager.prepareOffsets(this,
189 b)}this.positionAbs=this._convertPositionTo("absolute");if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis||this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";for(c=this.items.length-1;c>=0;c--){d=this.items[c];var f=d.item[0],g=this._intersectsWithPointer(d);if(g)if(f!=this.currentItem[0]&&this.placeholder[g==1?"next":"prev"]()[0]!=f&&!a.ui.contains(this.placeholder[0],f)&&(this.options.type=="semi-dynamic"?!a.ui.contains(this.element[0],
190 f):true)){this.direction=g==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(d))this._rearrange(b,d);else break;this._trigger("change",b,this._uiHash());break}}this._contactContainers(b);a.ui.ddmanager&&a.ui.ddmanager.drag(this,b);this._trigger("sort",b,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(b,c){if(b){a.ui.ddmanager&&!this.options.dropBehaviour&&a.ui.ddmanager.drop(this,b);if(this.options.revert){var d=this;c=d.placeholder.offset();
191 d.reverting=true;a(this.helper).animate({left:c.left-this.offset.parent.left-d.margins.left+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollLeft),top:c.top-this.offset.parent.top-d.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){d._clear(b)})}else this._clear(b,c);return false}},cancel:function(){if(this.dragging){this._mouseUp({target:null});this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):
192 this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate",null,this._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,this._uiHash(this));this.containers[b].containerCache.over=0}}}if(this.placeholder){this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();a.extend(this,
193 {helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?a(this.domPosition.prev).after(this.currentItem):a(this.domPosition.parent).prepend(this.currentItem)}return this},serialize:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{};a(c).each(function(){var f=(a(b.item||this).attr(b.attribute||"id")||"").match(b.expression||/(.+)[-=_](.+)/);if(f)d.push((b.key||f[1]+"[]")+"="+(b.key&&b.expression?f[1]:f[2]))});!d.length&&b.key&&d.push(b.key+"=");return d.join("&")},
194 toArray:function(b){var c=this._getItemsAsjQuery(b&&b.connected),d=[];b=b||{};c.each(function(){d.push(a(b.item||this).attr(b.attribute||"id")||"")});return d},_intersectsWith:function(b){var c=this.positionAbs.left,d=c+this.helperProportions.width,f=this.positionAbs.top,g=f+this.helperProportions.height,i=b.left,e=i+b.width,h=b.top,j=h+b.height,k=this.offset.click.top,l=this.offset.click.left;k=f+k>h&&f+k<j&&c+l>i&&c+l<e;return this.options.tolerance=="pointer"||this.options.forcePointerForContainers||
195 this.options.tolerance!="pointer"&&this.helperProportions[this.floating?"width":"height"]>b[this.floating?"width":"height"]?k:i<c+this.helperProportions.width/2&&d-this.helperProportions.width/2<e&&h<f+this.helperProportions.height/2&&g-this.helperProportions.height/2<j},_intersectsWithPointer:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top,b.height);b=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left,b.width);c=c&&b;b=this._getDragVerticalDirection();
196 var d=this._getDragHorizontalDirection();if(!c)return false;return this.floating?d&&d=="right"||b=="down"?2:1:b&&(b=="down"?2:1)},_intersectsWithSides:function(b){var c=a.ui.isOverAxis(this.positionAbs.top+this.offset.click.top,b.top+b.height/2,b.height);b=a.ui.isOverAxis(this.positionAbs.left+this.offset.click.left,b.left+b.width/2,b.width);var d=this._getDragVerticalDirection(),f=this._getDragHorizontalDirection();return this.floating&&f?f=="right"&&b||f=="left"&&!b:d&&(d=="down"&&c||d=="up"&&!c)},
197 _getDragVerticalDirection:function(){var b=this.positionAbs.top-this.lastPositionAbs.top;return b!=0&&(b>0?"down":"up")},_getDragHorizontalDirection:function(){var b=this.positionAbs.left-this.lastPositionAbs.left;return b!=0&&(b>0?"right":"left")},refresh:function(b){this._refreshItems(b);this.refreshPositions();return this},_connectWith:function(){var b=this.options;return b.connectWith.constructor==String?[b.connectWith]:b.connectWith},_getItemsAsjQuery:function(b){var c=[],d=[],f=this._connectWith();
198 if(f&&b)for(b=f.length-1;b>=0;b--)for(var g=a(f[b]),i=g.length-1;i>=0;i--){var e=a.data(g[i],this.widgetName);if(e&&e!=this&&!e.options.disabled)d.push([a.isFunction(e.options.items)?e.options.items.call(e.element):a(e.options.items,e.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),e])}d.push([a.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):a(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),
199 this]);for(b=d.length-1;b>=0;b--)d[b][0].each(function(){c.push(this)});return a(c)},_removeCurrentsFromItems:function(){for(var b=this.currentItem.find(":data("+this.widgetName+"-item)"),c=0;c<this.items.length;c++)for(var d=0;d<b.length;d++)b[d]==this.items[c].item[0]&&this.items.splice(c,1)},_refreshItems:function(b){this.items=[];this.containers=[this];var c=this.items,d=[[a.isFunction(this.options.items)?this.options.items.call(this.element[0],b,{item:this.currentItem}):a(this.options.items,
200 this.element),this]],f=this._connectWith();if(f)for(var g=f.length-1;g>=0;g--)for(var i=a(f[g]),e=i.length-1;e>=0;e--){var h=a.data(i[e],this.widgetName);if(h&&h!=this&&!h.options.disabled){d.push([a.isFunction(h.options.items)?h.options.items.call(h.element[0],b,{item:this.currentItem}):a(h.options.items,h.element),h]);this.containers.push(h)}}for(g=d.length-1;g>=0;g--){b=d[g][1];f=d[g][0];e=0;for(i=f.length;e<i;e++){h=a(f[e]);h.data(this.widgetName+"-item",b);c.push({item:h,instance:b,width:0,height:0,
201 left:0,top:0})}}},refreshPositions:function(b){if(this.offsetParent&&this.helper)this.offset.parent=this._getParentOffset();for(var c=this.items.length-1;c>=0;c--){var d=this.items[c];if(!(d.instance!=this.currentContainer&&this.currentContainer&&d.item[0]!=this.currentItem[0])){var f=this.options.toleranceElement?a(this.options.toleranceElement,d.item):d.item;if(!b){d.width=f.outerWidth();d.height=f.outerHeight()}f=f.offset();d.left=f.left;d.top=f.top}}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);
202 else for(c=this.containers.length-1;c>=0;c--){f=this.containers[c].element.offset();this.containers[c].containerCache.left=f.left;this.containers[c].containerCache.top=f.top;this.containers[c].containerCache.width=this.containers[c].element.outerWidth();this.containers[c].containerCache.height=this.containers[c].element.outerHeight()}return this},_createPlaceholder:function(b){var c=b||this,d=c.options;if(!d.placeholder||d.placeholder.constructor==String){var f=d.placeholder;d.placeholder={element:function(){var g=
203 a(document.createElement(c.currentItem[0].nodeName)).addClass(f||c.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!f)g.style.visibility="hidden";return g},update:function(g,i){if(!(f&&!d.forcePlaceholderSize)){i.height()||i.height(c.currentItem.innerHeight()-parseInt(c.currentItem.css("paddingTop")||0,10)-parseInt(c.currentItem.css("paddingBottom")||0,10));i.width()||i.width(c.currentItem.innerWidth()-parseInt(c.currentItem.css("paddingLeft")||0,10)-parseInt(c.currentItem.css("paddingRight")||
204 0,10))}}}}c.placeholder=a(d.placeholder.element.call(c.element,c.currentItem));c.currentItem.after(c.placeholder);d.placeholder.update(c,c.placeholder)},_contactContainers:function(b){for(var c=null,d=null,f=this.containers.length-1;f>=0;f--)if(!a.ui.contains(this.currentItem[0],this.containers[f].element[0]))if(this._intersectsWith(this.containers[f].containerCache)){if(!(c&&a.ui.contains(this.containers[f].element[0],c.element[0]))){c=this.containers[f];d=f}}else if(this.containers[f].containerCache.over){this.containers[f]._trigger("out",
205 b,this._uiHash(this));this.containers[f].containerCache.over=0}if(c)if(this.containers.length===1){this.containers[d]._trigger("over",b,this._uiHash(this));this.containers[d].containerCache.over=1}else if(this.currentContainer!=this.containers[d]){c=1E4;f=null;for(var g=this.positionAbs[this.containers[d].floating?"left":"top"],i=this.items.length-1;i>=0;i--)if(a.ui.contains(this.containers[d].element[0],this.items[i].item[0])){var e=this.items[i][this.containers[d].floating?"left":"top"];if(Math.abs(e-
206 g)<c){c=Math.abs(e-g);f=this.items[i]}}if(f||this.options.dropOnEmpty){this.currentContainer=this.containers[d];f?this._rearrange(b,f,null,true):this._rearrange(b,null,this.containers[d].element,true);this._trigger("change",b,this._uiHash());this.containers[d]._trigger("change",b,this._uiHash(this));this.options.placeholder.update(this.currentContainer,this.placeholder);this.containers[d]._trigger("over",b,this._uiHash(this));this.containers[d].containerCache.over=1}}},_createHelper:function(b){var c=
207 this.options;b=a.isFunction(c.helper)?a(c.helper.apply(this.element[0],[b,this.currentItem])):c.helper=="clone"?this.currentItem.clone():this.currentItem;b.parents("body").length||a(c.appendTo!="parent"?c.appendTo:this.currentItem[0].parentNode)[0].appendChild(b[0]);if(b[0]==this.currentItem[0])this._storedCSS={width:this.currentItem[0].style.width,height:this.currentItem[0].style.height,position:this.currentItem.css("position"),top:this.currentItem.css("top"),left:this.currentItem.css("left")};if(b[0].style.width==
208 ""||c.forceHelperSize)b.width(this.currentItem.width());if(b[0].style.height==""||c.forceHelperSize)b.height(this.currentItem.height());return b},_adjustOffsetFromHelper:function(b){if(typeof b=="string")b=b.split(" ");if(a.isArray(b))b={left:+b[0],top:+b[1]||0};if("left"in b)this.offset.click.left=b.left+this.margins.left;if("right"in b)this.offset.click.left=this.helperProportions.width-b.right+this.margins.left;if("top"in b)this.offset.click.top=b.top+this.margins.top;if("bottom"in b)this.offset.click.top=
209 this.helperProportions.height-b.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var b=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0])){b.left+=this.scrollParent.scrollLeft();b.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&a.browser.msie)b=
210 {top:0,left:0};return{top:b.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:b.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var b=this.currentItem.position();return{top:b.top-(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:b.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.currentItem.css("marginLeft"),
211 10)||0,top:parseInt(this.currentItem.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var b=this.options;if(b.containment=="parent")b.containment=this.helper[0].parentNode;if(b.containment=="document"||b.containment=="window")this.containment=[0-this.offset.relative.left-this.offset.parent.left,0-this.offset.relative.top-this.offset.parent.top,a(b.containment=="document"?
212 document:window).width()-this.helperProportions.width-this.margins.left,(a(b.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(b.containment)){var c=a(b.containment)[0];b=a(b.containment).offset();var d=a(c).css("overflow")!="hidden";this.containment=[b.left+(parseInt(a(c).css("borderLeftWidth"),10)||0)+(parseInt(a(c).css("paddingLeft"),10)||0)-this.margins.left,b.top+(parseInt(a(c).css("borderTopWidth"),
213 10)||0)+(parseInt(a(c).css("paddingTop"),10)||0)-this.margins.top,b.left+(d?Math.max(c.scrollWidth,c.offsetWidth):c.offsetWidth)-(parseInt(a(c).css("borderLeftWidth"),10)||0)-(parseInt(a(c).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,b.top+(d?Math.max(c.scrollHeight,c.offsetHeight):c.offsetHeight)-(parseInt(a(c).css("borderTopWidth"),10)||0)-(parseInt(a(c).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}},_convertPositionTo:function(b,c){if(!c)c=
214 this.position;b=b=="absolute"?1:-1;var d=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(d[0].tagName);return{top:c.top+this.offset.relative.top*b+this.offset.parent.top*b-(a.browser.safari&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:d.scrollTop())*b),left:c.left+this.offset.relative.left*b+this.offset.parent.left*b-(a.browser.safari&&
215 this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:d.scrollLeft())*b)}},_generatePosition:function(b){var c=this.options,d=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&a.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(d[0].tagName);if(this.cssPosition=="relative"&&!(this.scrollParent[0]!=document&&this.scrollParent[0]!=this.offsetParent[0]))this.offset.relative=this._getRelativeOffset();
216 var g=b.pageX,i=b.pageY;if(this.originalPosition){if(this.containment){if(b.pageX-this.offset.click.left<this.containment[0])g=this.containment[0]+this.offset.click.left;if(b.pageY-this.offset.click.top<this.containment[1])i=this.containment[1]+this.offset.click.top;if(b.pageX-this.offset.click.left>this.containment[2])g=this.containment[2]+this.offset.click.left;if(b.pageY-this.offset.click.top>this.containment[3])i=this.containment[3]+this.offset.click.top}if(c.grid){i=this.originalPageY+Math.round((i-
217 this.originalPageY)/c.grid[1])*c.grid[1];i=this.containment?!(i-this.offset.click.top<this.containment[1]||i-this.offset.click.top>this.containment[3])?i:!(i-this.offset.click.top<this.containment[1])?i-c.grid[1]:i+c.grid[1]:i;g=this.originalPageX+Math.round((g-this.originalPageX)/c.grid[0])*c.grid[0];g=this.containment?!(g-this.offset.click.left<this.containment[0]||g-this.offset.click.left>this.containment[2])?g:!(g-this.offset.click.left<this.containment[0])?g-c.grid[0]:g+c.grid[0]:g}}return{top:i-
218 this.offset.click.top-this.offset.relative.top-this.offset.parent.top+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollTop():f?0:d.scrollTop()),left:g-this.offset.click.left-this.offset.relative.left-this.offset.parent.left+(a.browser.safari&&this.cssPosition=="fixed"?0:this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:d.scrollLeft())}},_rearrange:function(b,c,d,f){d?d[0].appendChild(this.placeholder[0]):c.item[0].parentNode.insertBefore(this.placeholder[0],
219 this.direction=="down"?c.item[0]:c.item[0].nextSibling);this.counter=this.counter?++this.counter:1;var g=this,i=this.counter;window.setTimeout(function(){i==g.counter&&g.refreshPositions(!f)},0)},_clear:function(b,c){this.reverting=false;var d=[];!this._noFinalSort&&this.currentItem.parent().length&&this.placeholder.before(this.currentItem);this._noFinalSort=null;if(this.helper[0]==this.currentItem[0]){for(var f in this._storedCSS)if(this._storedCSS[f]=="auto"||this._storedCSS[f]=="static")this._storedCSS[f]=
220 "";this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper")}else this.currentItem.show();this.fromOutside&&!c&&d.push(function(g){this._trigger("receive",g,this._uiHash(this.fromOutside))});if((this.fromOutside||this.domPosition.prev!=this.currentItem.prev().not(".ui-sortable-helper")[0]||this.domPosition.parent!=this.currentItem.parent()[0])&&!c)d.push(function(g){this._trigger("update",g,this._uiHash())});if(!a.ui.contains(this.element[0],this.currentItem[0])){c||d.push(function(g){this._trigger("remove",
221 g,this._uiHash())});for(f=this.containers.length-1;f>=0;f--)if(a.ui.contains(this.containers[f].element[0],this.currentItem[0])&&!c){d.push(function(g){return function(i){g._trigger("receive",i,this._uiHash(this))}}.call(this,this.containers[f]));d.push(function(g){return function(i){g._trigger("update",i,this._uiHash(this))}}.call(this,this.containers[f]))}}for(f=this.containers.length-1;f>=0;f--){c||d.push(function(g){return function(i){g._trigger("deactivate",i,this._uiHash(this))}}.call(this,
222 this.containers[f]));if(this.containers[f].containerCache.over){d.push(function(g){return function(i){g._trigger("out",i,this._uiHash(this))}}.call(this,this.containers[f]));this.containers[f].containerCache.over=0}}this._storedCursor&&a("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!c){this._trigger("beforeStop",
223 b,this._uiHash());for(f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}return false}c||this._trigger("beforeStop",b,this._uiHash());this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.helper[0]!=this.currentItem[0]&&this.helper.remove();this.helper=null;if(!c){for(f=0;f<d.length;f++)d[f].call(this,b);this._trigger("stop",b,this._uiHash())}this.fromOutside=false;return true},_trigger:function(){a.Widget.prototype._trigger.apply(this,arguments)===false&&this.cancel()},
224 _uiHash:function(b){var c=b||this;return{helper:c.helper,placeholder:c.placeholder||a([]),position:c.position,originalPosition:c.originalPosition,offset:c.positionAbs,item:c.currentItem,sender:b?b.element:null}}});a.extend(a.ui.sortable,{version:"1.8.17"})})(jQuery);
225 jQuery.widget("ui.ncbiautocomplete",{options:{webserviceUrl:"/portal/utils/autocomp.fcgi",isUrlRelative:false,dictionary:"",responseFormat:"old",disableUrl:null,prefUrl:null,zIndex:1001,isEnabled:true,hasRelatedMatches:false,minLength:2,expandPauseTime:400,maxListLimit:null,isCrossDomain:false,disableCache:false,requireValidation:false},_create:function(){if(this.options.localData&&!this.options.dictionary)this.options.dictionary="local";this._storeTitleAttribute();this._createOptionsBox();this._addAttributes();
226 this._setHandlers();this._setWebServicePath();this._lastEnteredTerm="";this._setSGData()},_storeTitleAttribute:function(){this.element.data("ncbiautocompleteOriginalTitle",this.element.attr("title"))},destroy:function(){jQuery.Widget.prototype.destroy.apply(this,arguments);this.element.removeAttr("title");this._destroyAria();this._destroyHandlers();var a=this.element.data("ncbiautocompleteOriginalTitle");a&&this.element.attr("title",a)},_destroyOptionsBox:function(){jQuery.ui.ncbiautocomplete._globalOptionsList.optionsBox!=
227 null&&jQuery.ui.ncbiautocomplete._globalOptionsList.optionsBox.remove()},_destroyHandlers:function(){this.element.off("keypress keydown keyup cut paste")},_destroyAria:function(){this.element.removeAttr("aria-haspopup").removeAttr("aria-autocomplete").removeAttr("role").removeAttr("autocomplete")},_activeRequest:null,_keys:{up:38,down:40,enter:13,escape:27,tab:9,shift:16},_setSGData:function(){this.sgData={jsevent:"autocomplete",userTyped:"",hasScrolled:false,usedArrows:false,selectionAction:"",optionSelected:"",
228 optionIndex:-1,optionsCount:-1}},_addAttributes:function(){this.element.attr({title:"Use up and down arrows to choose an item from the autocomplete.","aria-haspopup":true,"aria-autocomplete":"list",role:"textbox"})},_setHandlers:function(){var a=this;jQuery(this.element).focus(function(){a._focused()}).keypress(function(c){a._keyPress(c,"press")}).keydown(function(c){a._keyPress(c,"down")}).keyup(function(c){a._keyUp(c)}).bind("cut paste",function(){a._changeFired()}).attr("AUTOCOMPLETE","OFF");var b=
229 jQuery(this.element)[0];b.autocomplete="off";b.AUTOCOMPLETE="OFF";jQuery(window).resize(function(){a._isActive&&a._positionOptionsBox()});jQuery(document).click(function(c){a._checkClickEvent(c)});jQuery(this._gol.optionsBox).hover(function(){if(a._isActive)a._isOptionsBoxFocused=true},function(){if(a._isActive)a._isOptionsBoxFocused=false})},_isOptionsBoxFocused:false,_createOptionsBox:function(){if(jQuery.ui.ncbiautocomplete._globalOptionsList===null){jQuery.ui.ncbiautocomplete._globalOptionsList=
230 {};var a=jQuery("div.grid");a=a.length===1?a:jQuery(document.body);jQuery.ui.ncbiautocomplete._globalOptionsList.optionsBox=jQuery("<div class='ui-ncbiautocomplete-holder shadow' aria-live='assertive'></div>").appendTo(a);jQuery.ui.ncbiautocomplete._globalOptionsList.optionsList=jQuery("<ul class='ui-ncbiautocomplete-options' role='listbox' aria-activedescendant=''></ul>").appendTo(jQuery(jQuery.ui.ncbiautocomplete._globalOptionsList.optionsBox));jQuery.ui.ncbiautocomplete._globalOptionsList.optionsActions=
231 jQuery("<div class='ui-ncbiautocomplete-actions shadow'></div>").appendTo(jQuery(jQuery.ui.ncbiautocomplete._globalOptionsList.optionsBox));jQuery.ui.ncbiautocomplete._globalOptionsList.prefLink=jQuery("<a href='#' class='ui-ncbiautocomplete-link-pref'>Preferences</a>").appendTo(jQuery(jQuery.ui.ncbiautocomplete._globalOptionsList.optionsActions));jQuery.ui.ncbiautocomplete._globalOptionsList.turnOffLink=jQuery("<a href='#' class='ui-ncbiautocomplete-link-off'>Turn off</a>").appendTo(jQuery(jQuery.ui.ncbiautocomplete._globalOptionsList.optionsActions));
232 jQuery.ui.ncbiautocomplete._globalOptionsList.isIE6=jQuery.browser.msie&&parseInt(jQuery.browser.version,10)<7;if(jQuery.ui.ncbiautocomplete._globalOptionsList.isIE6)jQuery.ui.ncbiautocomplete._globalOptionsList.optionsBox.iframe=jQuery("<iframe src='javascript:\"\";' class='ui-ncbiautocomplete-iframe' marginwidth='0' marginheight='0' align='bottom' scrolling='no' frameborder='0'></iframe>").appendTo(document.body)}this._gol=jQuery.ui.ncbiautocomplete._globalOptionsList},_positionOptionsBox:function(){if(this._gol.activeElement){var a=
233 jQuery(this.element),b=jQuery(this._gol.activeElement);a=a.attr("id")||a[0];b=b.attr("id")||b[0];a!==b&&this._hideOptions()}var c=this;if(this._gol.activeElement!==this.element){b=this.options.prefUrl!==null?"block":"none";a=this.options.disableUrl!==null?"block":"none";var d=b==="block"||a==="block"?"block":"none";jQuery(this._gol.prefLink).css("display",b).attr("href",this.options.prefUrl).unbind("click").click(function(){c._prefLinkClick()});jQuery(this._gol.turnOffLink).css("display",a).unbind("click").click(function(j){c.turnOff();
234 j.preventDefault()});jQuery(this._gol.optionsActions).css("display",d);jQuery(this._gol.optionsActions).children(":nth-child(2)").addClass("ui-ncbiautocomplete-link-pref-right")}else this._gol.activeElement=this.element;d=this.element;var f=jQuery(this._gol.optionsBox),g=false;if(d.parent().hasClass("jig-ncbiclearbutton-wrap")){d=d.parent();g=true;f.addClass("ui-ncbiautocomplete-holder-clearfix")}else f.removeClass("ui-ncbiautocomplete-holder-clearfix");b=d.outerWidth();a=d.outerHeight();d=d.offset();
235 var i,e,h;if(jQuery.browser.msie)h=e=i=0;else{i=parseInt(f.css("borderLeftWidth"),10);e=parseInt(f.css("borderRightWidth"),10);h=g?0:-1}f.css("top",d.top+a+(g?-1:-2)+"px").css("left",d.left+"px").width(b-i-e+h+"px");g=parseInt(this.options.zIndex,10);f.css("zIndex",g);f=jQuery(this._gol.optionsList);f[0].onscroll=function(){};f.scrollTop(0);f[0].onscroll=function(){c.sgData.hasScrolled=true};if(this._gol.isIE6){f=jQuery(this._gol.optionsBox.iframe);f.css("top",d.top+a+"px").css("left",d.left+"px").width(b-
236 i-e+h+"px");f.css("zIndex",g-1)}},_isActive:false,_focused:function(){this._gol.activeElement!==this.element&&this._hideOptions();this._setActivedescendant();this._positionOptionsBox();if(this.options.isEnabled){this._isActive=true;this._hasBeenEscaped=false}this.options.minLength===0&&this.options.localData&&this._keyUp({})},_lastEnteredTerm:null,_isCached:false,_hasBeenEscaped:false,_lastKeyPressDwnUpScroll:new Date,_lastFoundMatch:null,_findMatchInCache:function(a){this._lastFoundMatch=null;if(typeof this._localCache[this.options.dictionary]===
237 "undefined")return false;var b="l"+(this.options.maxListLimit||"n");if(typeof this._localCache[this.options.dictionary][b]==="undefined")return false;for(var c=0;a.length>1||c<10;){a=a.substr(0,a.length-1);var d=this._localCache[this.options.dictionary][b][a];if(d)if(d.isCompleteList){this._lastFoundMatch=a;return true}else break;c++}return false},_cloneMatchObject:function(a){var b={};b.matchedText=a.matchedText.toString();b.matches=a.matches?a.matches.slice():[];b.isCompleteList=a.isCompleteList===
238 true;return b},_timerTriggerEnterEvent:null,_clearTriggerEnterEvent:function(){this._timerTriggerEnterEvent=null},_triggerEnterEvent:function(){var a=this;if(!this._timerTriggerEnterEvent){this._timerTriggerEnterEvent=window.setTimeout(function(){a._clearTriggerEnterEvent()},50);this.element.trigger("ncbiautocompleteenter",this.sgData);this.element.trigger("ncbiautocompletechange",this.sgData);this._sgSend()}},_triggerTabEvent:function(){this.element.trigger("ncbiautocompletetab",this.sgData);this.element.trigger("ncbiautocompletechange",
239 this.sgData);this._sgSend()},_keyPress:function(a,b){var c=false,d=this;if(a.keyCode===this._keys.enter||a.keyCode===this._keys.tab){var f=a.keyCode===this._keys.enter,g=false;if(this._isActive&&this.isOptionsBoxOpen())if(this._currIndex===this.options.maxListLimit&&jQuery("li:eq("+this._currIndex+")",this._gol.optionsList).hasClass("ui-ncbiautocomplete-show-more")){this._hideOptions(true);this._gotoShowAll()}else if(this.sgData.optionSelected===jQuery(this.element).val()){g=f;if(!this._timerTriggerEnterEvent){this.sgData.selectionAction=
240 f?"enter":"tab";this.element.attr("valueId",this.element.attr("_optValue")||null);if(f)this._triggerEnterEvent();else{this._sentTab||this._triggerTabEvent();this._sentTab=true;window.setTimeout(function(){d._sentTab=false},10)}}this._hideOptions(true);if(f){a.stopPropagation();a.preventDefault();return false}}else a.keyCode===this._keys.tab&&this._hideOptions(true);else if(a.keyCode===this._keys.tab)if(!this._tabCalled){this._hideOptions(true);this._tabCalled=true;window.setTimeout(function(){d._tabCalled=
241 false},10)}if(f&&!g){this._hideOptions(true);this._triggerEnterEvent()}}else if(jQuery(this.element).val().length===0&&!this.options.localData)this._hideOptions(true);else if(a.keyCode===this._keys.up){c=true;this._scrollUpDownRateLimiter(-1)}else if(a.keyCode===this._keys.down&&!a.shiftKey){if(jQuery(this.element).val().length>=this.options.minLength&&!this.isOptionsBoxOpen()){this._reopenOptions=true;c=false;return}this._reopenOptions=false;c=true;this._scrollUpDownRateLimiter(1)}if(!this._lastKeyAction||
242 b===this._lastKeyAction){this._lastKeyAction=b;this._prevWasArrow=this._usedArrow;this._usedArrow=c}},_scrollUpDownRateLimiter:function(a){if(!(new Date-this._lastKeyPressDwnUpScroll<90)){this._moveSelection(a);this._lastKeyPressDwnUpScroll=new Date}},_checkArrowSelection:function(a){if(this._prevWasArrow&&a.keyCode!==this._keys.down&&a.keyCode!==this._keys.up&&a.keyCode!==this._keys.tab&&a.keyCode!==this._keys.enter&&this._isActive&&this.isOptionsBoxOpen()){this.sgData.selectionAction="arrows";typeof ncbi!==
243 "undefined"&&ncbi.sg&&ncbi.sg.ping&&ncbi.sg.ping(this.sgData,false);this._usedArrow=this._prevWasArrow=false}},_keyUp:function(a){if(!(!this.options.isEnabled||this._hasBeenEscaped)){this._checkArrowSelection(a);var b=jQuery(this.element).val().toLowerCase().replace(/^\s+/,"").replace(/\s+$/," "),c="l"+(this.options.maxListLimit||"n");if(!((a.keyCode===this._keys.up||a.keyCode===this._keys.down||a.keyCode===this._keys.enter)&&!this._reopenOptions))if(a.keyCode===this._keys.tab&&this._isOptionsBoxFocused){this._isActive=
244 this._isOptionsBoxFocused=false;a.type!=="keyup"&&this._hideOptions(true)}else if(a.keyCode===this._keys.escape){this._isActive=this._isOptionsBoxFocused=false;this._hasBeenEscaped=true;this._hideOptions(true)}else if(!(this._lastEnteredTerm===b||a.keyCode===this._keys.shift))if(this._localCache[this.options.dictionary]&&this._localCache[this.options.dictionary][c]&&this._localCache[this.options.dictionary][c][b]){this._isActive=true;this._resetValueId(b);this._lastEnteredTerm=b;this._displayOptions(this._localCache[this.options.dictionary][c][b])}else if(this._isCached&&
245 this._findMatchInCache(b)){this._isActive=true;this._localCache[this.options.dictionary][c][b]=this._cloneMatchObject(this._localCache[this.options.dictionary][c][this._lastFoundMatch]);this._resetValueId(b);this._lastEnteredTerm=b;this._filteredCache(b)}else if(b.length>=this.options.minLength&&this.options.localData){if(!this._localCache||!this._localCache[this.options.dictionary]||!this._localCache[this.options.dictionary][c]||!this._localCache[this.options.dictionary][c]["*_*_local_*_*"])this._putInCache({matchedText:"*_*_local_*_*",
246 matches:this.options.localData.slice(),isCompleteList:true},"*_*_local_*_*");this._isActive=true;this._localCache[this.options.dictionary][c][b]=this._cloneMatchObject(this._localCache[this.options.dictionary][c]["*_*_local_*_*"]);this._resetValueId(b);this._lastEnteredTerm=b;this._filteredCache(b)}else if(b.length>=this.options.minLength&&this.options.webserviceUrl){if(!this._isActive){this._isActive=true;this._focused()}if(this._lastEnteredTerm!==b){this._resetValueId(b);this._lastEnteredTerm=b;
247 this._fecthOptions(b)}}else{this._resetValueId(b);this._hideOptions()}}},_resetValueId:function(a){this._lastEnteredTerm&&this._lastEnteredTerm.toLowerCase()===a||this._lastTextInTextbox&&this._lastTextInTextbox.toLowerCase()===a||this.element.attr("valueId",null)},_changeFired:function(){this._lastEnteredTerm!==this.element.val()&&this._resetValueId()},_webSerivcePath:null,_setWebServicePath:function(){var a=this.options.webserviceUrl;if(a){var b="";if(this.options.isCrossDomain)this._webSerivcePath=
248 "http://www.ncbi.nlm.nih.gov/portal/utils/autocomp.fcgi";else{if(!this.options.isUrlRelative){b=window.location.protocol+"//"+window.location.host;if(a.charAt(0)!=="/")a="/"+a}this._webSerivcePath=b+a}}},_fecthOptions:function(a){this._activeRequest!==null&&this._activeRequest.abort();var b=this,c=this.options.responseFormat==="old"?"text":"json";a={dict:this.options.dictionary,q:a};if(this.options.isCrossDomain){this._addGlobalListener("NSuggest_CreateData");jQuery.ajax({url:this._webSerivcePath,
249 dataType:"script",data:a,cache:true})}else this._activeRequest=jQuery.get(this._webSerivcePath,a,function(d,f){b._handleResponse(d,f)},c)},_handleResponse:function(a,b){this._activeRequest=null;if(b==="success")this.options.responseFormat==="old"?this._oldFormat(a):this._displayOptions(a);else this.turnOff()},_addGlobalListener:function(a,b){var c=this;window[a]=function(d,f,g){d={matchedText:d,matches:f,isCompleteList:g===1};if(b)return d;else c._displayOptions(d)}},_oldFormat:function(a){if(a.indexOf("_dictionary_error")!==
250 -1)this.turnOff(true);else if(jQuery.trim(a).indexOf("NSuggest_CreateData")!==-1){this._addGlobalListener("NSuggest_CreateData_new");eval(a.replace("NSuggest_CreateData","NSuggest_CreateData_new"))}else this._hideOptions()},_localCache:{},_putInCache:function(a,b){if(!this.options.disableCache){var c="l"+(this.options.maxListLimit||"n");this._localCache[this.options.dictionary]||(this._localCache[this.options.dictionary]={});this._localCache[this.options.dictionary][c]||(this._localCache[this.options.dictionary][c]=
251 {});this._localCache[this.options.dictionary][c][b||this._lastEnteredTerm]||(this._localCache[this.options.dictionary][c][b||this._lastEnteredTerm]=a)}},_setActivedescendant:function(){var a=this.element.attr("id");if(!a){a=jQuery.ui.jig._generateId("ncbiautocomplete");this.element.attr("id",a)}jQuery(this._gol.optionsBox).find("ul:eq(0)").attr("aria-activedescendant",a)},_displayOptions:function(a){this._setActivedescendant();this._putInCache(a);var b=a.matchedText,c=a.matches||[];if(b!==this._lastEnteredTerm){a.isCompleteList=
252 true;this._filteredCache(this._lastEnteredTerm,a)}else{this.sgData.userTyped=this._lastEnteredTerm;this.sgData.optionsCount=c;this._positionOptionsBox();var d=this;if(b==="_dictionary_error")this.turnOff(true);else{this._isCached=a.isCompleteList;b=a.previousFormat;if(!b){var f=this.options.maxListLimit;b=0;var g;if(f===null||c.length<=f)g=c.length;else{g=f;b=c.length-g}f=(this._lastEnteredTerm||"").replace(/([\^\$\\\?\(\)\[\]\*\+\{\}\|\/\.\,])/g,"\\$1");var i=new RegExp("("+f+")","i");f=new Array(c.length);
253 var e=this.options.hasRelatedMatches;for(g=g-1;g>=0;g--){var h=c[g],j="",k=h.indexOf("@");if(k!==-1){j='valueId="'+h.substr(k+1)+'"';h=h.substr(0,k);e=true}f[g]="<li role='menuitem' "+j+">"+h.replace(i,"<span>$1</span>").replace(/\\"/g,'"')+"</li>"}b>0&&f.push("<li class='ui-ncbiautocomplete-show-more' role='menuitem' moreOption='true'>See all results</li>");b=f.join("");if(f.length===0||!e&&b.indexOf("<span>")===-1){this._hideOptions();return}a.previousFormat=b}c=jQuery(this._gol.optionsBox);a=jQuery(this._gol.optionsList);
254 a.scrollTop(0);a.html(b);if(c.css("display")!=="block"&&this._isActive){c.css("display","block");if(this._gol.isIE6){b=jQuery(this._gol.optionsBox.iframe).css("display","block");b.height(b.height()+jQuery(this._gol.optionsActions).height())}}else this._isActive||this._hideOptions();b=jQuery(".ui-ncbiautocomplete-options li");f=(b.eq(0).outerHeight()||20)*b.length;b.closest(".ui-ncbiautocomplete-holder").height(f).css("min-height",f+"px");b.closest(".ui-ncbiautocomplete-options").height(f).css("overflow-y",
255 "hidden");b=c.width();jQuery("li",a).hover(function(){d._addHightlightMouse(this)},function(){d._removeHighlight("mouse")}).click(function(){d._optionClicked(this);return false});jQuery(a).mouseleave(function(){d._removeHighlight("mouse");d._resetCurrentIndex()});this._resetCurrentIndex();c=jQuery("li",c);b=jQuery(this._gol.optionsBox).width();var l=jQuery.browser.msie&&!this._gol.isIE6||jQuery.browser.safari||jQuery.browser.opera;f=c.eq(0);parseFloat(f.css("padding-left"));e=f.html();f.html("<span>MMMMMMMMM.</span>");
256 i=f.children("span:first").width()/10;f.html("<span>&hellip;<span>");f.children("span:first").width();f.html(e);var n=a.width(),s=Math.floor(b/i);c.each(function(){var r=jQuery(this);r.css("white-space","nowrap");var v=r.html();r.attr("fullText",v).attr("acValue",v.replace(/<\/?span>/gi,""));if(r.width()/r.attr("acValue").length<9)if(l)r.attr("partialText",r.html()).attr("isIEExpand",true).css("width",n-28+"px");else{var o=v.toLowerCase().indexOf("<span>"),q=v.toLowerCase().indexOf("</span>"),m=function(w){var y=
257 false;if(w>=o&&w<o+6){w=w-o;w=o+w;y=true}if(w>=q&&w<q+7){w=w-q;w=q+w}return{cutLoc:w,addSpan:y}},p=function(w,y,C,D,A){v.indexOf("Journal of magnetic");w=m(w);var E=v.substr(0,w.cutLoc)+(w.addCloseSpan?"</span>":"")+"&hellip;";r.html(E);if(E===D){if(r.height()!==x&&typeof A!=="undefined")E=A;r.attr("partialText",E).css("white-space","nowrap")}else if(r.height()===x){y=E.toString()+"";A=Math.floor((w.cutLoc+C)/2);p(A,w.cutLoc,C,E,y)}else{C=Math.floor((parseInt(w.cutLoc,10)+parseInt(y,10))/2);p(C,y,
258 w.cutLoc,E,A)}};r.css("white-space","normal").css("width",n-22+"px");var u=r.height();r.html(".");var x=r.height();r.html(v);u>x&&p(s,0,v.length)}});a.scrollTop(0);this._removeHighlight("mouse");this._hideOptionsIfOffPage()}}},_filteredCache:function(a,b){var c=true,d="l"+(this.options.maxListLimit||"n");if(a===null)c=false;else{if(b){b=b;if(typeof this._localCache[this.options.dictionary]==="undefined")this._localCache[this.options.dictionary]={};else if(typeof this._localCache[this.options.dictionary][d]===
259 "undefined")this._localCache[this.options.dictionary][d]={}}else b=this._localCache[this.options.dictionary][d][a];b.matchedText=a;var f=this.options.minLength===0&&a.length===0;if(!this.options.hasRelatedMatches){c=a.replace(/([\^\$\\\?\(\)\[\]\*\+\{\}\|\/\.\,])/g,"\\$1");c=new RegExp(c,"ig");for(var g=b.matches.join("!!!~~~!!!").split("!!!~~~!!!"),i=g.length-1;i>=0;i--)!f&&g[i].match(c)===null&&g.splice(i,1);b.matches=g;this._localCache[this.options.dictionary][d][a]=b;c=g.length>0}}c?this._displayOptions(this._localCache[this.options.dictionary][d][a]):
260 this._hideOptions()},_removeHighlight:function(a){if(!(a==="mouse"&&new Date-this._lastKeyPressDwnUpScroll<100)){var b=this;jQuery("li",this._gol.optionsList).removeClass("ui-ncbiautocomplete-options-high").each(function(){b._collapseOption(this)})}},_addHightlightMouse:function(a){if(new Date-this._lastKeyPressDwnUpScroll>100){this._resetCurrentIndex();this._currIndex=jQuery(a).prevAll("li").length;this._addHightlight(a)}},_addHightlight:function(a){this._removeHighlight();jQuery(a).addClass("ui-ncbiautocomplete-options-high");
261 var b=this;this._expandTimer&&window.clearTimeout(this._expandTimer);this._expandTimer=window.setTimeout(function(){b._expandOption(a)},this.options.expandPauseTime)},_expandOption:function(a){if(jQuery(a).hasClass("ui-ncbiautocomplete-options-high")){a=jQuery(a).attr("isExpanded",true);var b=a.attr("fullText");if(a.html()!==b||a.attr("isIEExpand")){a.html(b).css("text-overflow","").css("white-space","normal").css("-o-text-overflow","");this._scrollIntoView()}}},_collapseOption:function(a){a=jQuery(a);
262 a.attr("isIEExpand")?a.css("text-overflow","ellipsis").css("white-space","nowrap").css("-o-text-overflow","ellipsis"):a.css("white-space","nowrap").html(a.attr("partialText"))},_optionClicked:function(a){a=jQuery(a);if(a.hasClass("ui-ncbiautocomplete-show-more"))this._gotoShowAll();else{var b=this._cleanUpSelectionText(a);a=a.attr("valueId")||null;this.sgData.optionSelected=b;this.sgData.optionIndex=this._currIndex;this.sgData.valueId=a;this.sgData.selectionAction="click";this._sgSend();b=jQuery(this.element).val(b);
263 b.attr("valueid",a);b.trigger("ncbiautocompleteoptionclick",this.sgData);b.trigger("ncbiautocompletechange",this.sgData)}this._isOptionsBoxFocused=false;this._hideOptions()},isOptionsBoxOpen:function(){return jQuery(this._gol.optionsBox).css("display")==="block"},_hideOptions:function(a){this._gol.activeElement=null;if(!(this._isOptionsBoxFocused&&!a)){var b=jQuery(this._gol.optionsBox);a&&jQuery(this._gol.optionsBox).css("display","none");b.attr("aria-activedescendant")===this.element.attr("id")&&
264 b.attr("aria-activedescendant","");this._gol.isIE6&&jQuery(this._gol.optionsBox.iframe).css("display","none");this._resetCurrentIndex();this._isActive=false;this._lastEnteredTerm=null;b=jQuery(this._gol.optionsBox);var c=jQuery(this._gol.optionsList);b.css("display","none");c.html("");this._lastTextInTextbox=b=this.element.val();if(this.options.requireValidation&&b.length>0&&this.options.isEnabled&&(!this.element.is(":focus")||a))this._trigger((b.length<this.options.minLength?false:this.isInDictionary(b))?
265 "validselection":"invalidselection")}},_setTextCursorToEnd:function(a){var b=this.element;jQuery(b).val(a);if(b.createTextRange){a=b.createTextRange();a.moveStart("character",b.value.length);a.collapse();a.select()}},_resetCurrentIndex:function(){this._currIndex=-1},_cleanUpSelectionText:function(a){return jQuery.trim(a.attr("acValue")).replace(/&amp;/gi,"&").replace(/\\"/g,'"')},_currIndex:-1,_moveSelection:function(a){if(this._isActive){this.sgData.usedArrows=true;var b=jQuery("li",this._gol.optionsList).length;
266 this._currIndex+=a;this._removeHighlight();a=this._lastEnteredTerm;var c="";if(!(a===null||a.length<this.options.minLength)){if(this._currIndex<0||this._currIndex>=b)this._currIndex=this._currIndex===-2?b-1:-1;if(this._currIndex!==-1){b=jQuery("li:eq("+this._currIndex+")",this._gol.optionsList);this._addHightlight(b);if(this._currIndex===this.options.maxListLimit){this.sgData.optionSelected="";this.sgData.valueId=""}else{a=this._cleanUpSelectionText(b);c=b.attr("valueId")||null;this.sgData.optionSelected=
267 a;this.sgData.valueId=c}}else{this.sgData.optionSelected="";this.sgData.valueId=""}this.element.attr("_optValue",c);this.element.attr("valueId",c);this._setTextCursorToEnd(a);this._scrollIntoView();this.sgData.optionIndex=this._currIndex}}},_scrollIntoView:function(){var a=jQuery("li:eq("+this._currIndex+")",this._gol.optionsList);if(a.length!==0){var b=jQuery(this._gol.optionsList),c=b.height(),d=b.scrollTop(),f=a[0].offsetTop;a=a.height();if(f-c+a>d){d=jQuery("li:eq("+(this._currIndex+1)+")",this._gol.optionsList);
268 b.scrollTop((d.length===1?d[0].offsetTop:f+a+10)-c)}else f<d&&b.scrollTop(f)}},enableAutocomnplete:function(){this.options.isEnabled=true},disableAutocomnplete:function(){this.disableAutocomplete()},disableAutocomplete:function(){this._isOptionsBoxFocused=this.options.isEnabled=false;this._hideOptions()},turnOff:function(a){this.disableAutocomplete();var b=this.element.data("ncbiautocompleteOriginalTitle");b&&this.element.attr("title",b);if(!a){typeof ncbi!=="undefined"&&ncbi.sg&&ncbi.sg.ping&&ncbi.sg.ping(this.element[0],
269 "autocompleteoffclick","dictionary="+this.options.dictionary);this.element.trigger("ncbiautocompletedisableclicked");a=this.options.disableUrl;if(a!==null&&a.length>0){b=jQuery.ui.jig._getFncFromStr(a);typeof b==="function"?b():jQuery.get(a)}}},_prefLinkClick:function(){typeof ncbi!=="undefined"&&ncbi.sg&&ncbi.sg.ping&&ncbi.sg.ping(this.element[0],"autocompleteprefclick","dictionary="+this.options.dictionary)},_checkClickEvent:function(a){if(this._isActive)if(jQuery(this.element)[0]!=a.target){this._isActive=
270 this._isOptionsBoxFocused=false;this._hideOptions()}},_sgSend:function(){typeof ncbi!=="undefined"&&typeof ncbi.sg!=="undefined"&&typeof ncbi.sg.ping!=="undefined"&&ncbi.sg.ping(this.sgData,false)},getSgData:function(){return this.sgData},_gotoShowAll:function(){var a=jQuery(this.element),b=a.val();a.trigger("ncbiautocompleteshowall",{value:b,dictionary:this.options.dictionary})},_hideOptionsIfOffPage:function(){if(this.options.maxListLimit){var a=this,b=jQuery(".ui-ncbiautocomplete-options li"),
271 c=b.eq(0).outerHeight()||20,d=jQuery(this._gol.optionsBox),f=jQuery(window).height(),g=d.position().top,i=g+d.outerHeight()-(document.body.scrollTop||document.documentElement.scrollTop||window.pageYOffset||0);if(b.last().hasClass("ui-ncbiautocomplete-show-more")){var e=g+"-"+f+"-"+i;if(!this.choppedDetails)this.choppedDetails={};var h=this.choppedDetails[e],j=0,k=function(){i=g+d.outerHeight()-(document.body.scrollTop||document.documentElement.scrollTop||window.pageYOffset||0);if(i>f){b=jQuery(".ui-ncbiautocomplete-options li");
272 var n=b.length-2;if(n>=0){b.eq(n).remove();sz=c*(b.length-1);b.closest(".ui-ncbiautocomplete-holder").height(sz).css("min-height",sz+"px");b.closest(".ui-ncbiautocomplete-options").height(sz).css("overflow-y","hidden");j++;k()}}else a.choppedDetails[e].count=j};if(h){var l=h.count;if(l>0){h=2*h.length-l-b.length-2;b.filter(":lt("+(b.length-1)+")").filter(":gt("+h+")").remove();b=jQuery(".ui-ncbiautocomplete-options li");sz=c*b.length;b.closest(".ui-ncbiautocomplete-holder").height(sz).css("min-height",
273 sz+"px");b.closest(".ui-ncbiautocomplete-options").height(sz).css("overflow-y","hidden")}j=l}else this.choppedDetails[e]={count:0,length:b.length};k()}else{l=Math.floor((f-g)/c)*c;h=b.length*c;if(l>h)l=h;b.closest(".ui-ncbiautocomplete-holder").height(l).css("min-height",l+"px");b.closest(".ui-ncbiautocomplete-options").height(l).css("overflow-y","auto")}}},isValid:function(){return this.isInDictionary(this.element.val())},isInDictionary:function(a){var b=false;if(a&&a.length>=this.options.minLength&&
274 this.options.dictionary&&this.options.dictionary.length>0&&this.options.isEnabled){var c=false,d="l"+(this.options.maxListLimit||"n"),f=a.toLowerCase();if(this._localCache[this.options.dictionary]&&this._localCache[this.options.dictionary][d]){d=this._localCache[this.options.dictionary][d];c=true;if(d[f])b=this._isValidCheck(f,d[f].matches);else for(var g in d)if(b=this._isValidCheck(f,d[g].matches))break}if(!b&&!c)b=this._validSeverCall(a)}return b},_validSeverCall:function(a){var b=false,c;if(this.options.isCrossDomain){typeof console!==
275 "undefined"&&console.warn&&console.warn("Can not do this test with cross domain calls");return false}else if(this.options.dictionary.length>0){var d=this.options.responseFormat==="old"?"text":"json";c={dict:this.options.dictionary,q:a};c=jQuery.ajax({url:this._webSerivcePath,data:c,async:false,dataTypeString:d});if(c.status===200){c=c.responseText;b="NSuggest_CreateData_test"+(new Date).getTime();this._addGlobalListener(b,true);c=eval(c.replace("NSuggest_CreateData",b));window[b]=null;b=this._isValidCheck(a,
276 c.matches)}}return b},_isValidCheck:function(a,b){var c=false;if(b){c=jQuery.inArray(a.toLowerCase(),b)>-1;if(!c){var d=new RegExp("(^|@)("+a.toLowerCase()+")(@|$)","i");jQuery.each(b,function(f,g){if(g.match(d)){c=true;return false}})}}return c}});jQuery.ui.ncbiautocomplete._globalOptionsList=null;
277 jQuery.widget("ui.ncbiaccordion",jQuery.ui.accordion,{orgCreate:jQuery.ui.accordion.prototype._create,_create:function(){this.options.header=":header";this.element.hasClass("jig-accordion")&&typeof console!=="undefined"&&console.warn&&console.warn("The classname widget identifier jig-accordion has been depreciated, please change it to jig-ncbiaccordion");this.orgCreate()}});
278 (function(a){a.widget("ui.ncbidialog",a.ui.dialog,{options:{autoOpen:false,draggable:false,isTitleVisible:true,open:null,openEvent:"click",resizable:false,destSelector:null,stdOKCancel:false,stdOKText:"OK",stdCancelText:"Cancel"},_create:function(){if(this.element[0].tagName.toLowerCase()!=="div"){this.isTrigger=true;this._triggerNode=this.element}else this.isTrigger=false;if(this.isTrigger)this._ajaxable=this._ajaxable(this._triggerNode);var b=this.isTrigger?this.getDialogNode():this.element;this.element=
279 b;if(this.isTrigger){var c=this;this._triggerNode[this.options.openEvent](function(f){f.preventDefault();a(f.target);c._ajaxable&&c._getContent();c.element.dialog("open")})}if(!b.data("jigncbidialogcreated")){var d=this.element.attr("title");if(d)this.element.data("title",d);else d=this.element.data("title");if(b.length===0)a.ui.jig._isConsole("error")&&console.error('ncbidialog: No matching dialog node found with selector "'+this.options.destSelector+'".');else{this._parseCallbacks();this._overrideEvents();
280 b.dialog(this.options);this.options.isTitleVisible||b.prev(".ui-dialog-titlebar").addClass("ui-helper-hidden-accessible").css("position","absolute");this._renderButtonMarkup();this._doStdOKCancel();if(d){c=this;this.element.bind("dialogopen",function(){c.element.dialog("option","title",d)})}b.data("jigncbidialogcreated",true)}}},getStdOKButton:function(){var b=null;if(this.options.stdOKCancel)b=this._dialogNode.find("div.ui-dialog-buttonpane button.ui-ncbibutton-submit");return b},_doStdOKCancel:function(){if(this.options.stdOKCancel){var b=
281 jQuery('<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"></div>'),c=jQuery('<button class="ui-ncbibutton-submit">'+this.options.stdOKText+"</button>"),d=jQuery('<button class="ui-ncbibutton-cancel">'+this.options.stdCancelText+"</button>");c.ncbibutton({color:"blue"});d.ncbibutton();var f=this;d.click(function(){f._triggerNode.ncbidialog("close");jQuery(this).trigger("ncbidialogcancelclick")});c.click(function(){jQuery(this).trigger("ncbidialogokclick")});b.append(c);b.append(d);
282 this.element.append(b)}},_overrideEvents:function(){for(var b=this,c=this.isTrigger?this._triggerNode:this.element,d=["dialogopen","dialogbeforeclose","dialogfocus","dialogdragstart","dialogdrag","dialogdragstop","dialogresizestart","dialogresize","dialogresizestop","dialogclose"],f=0;f<d.length;f++)(function(g){b.element.bind(g,function(){c.trigger("ncbi"+g)})})(d[f])},_parseCallbacks:function(){for(var b=["open","beforeClose","focus","dragStart","drag","dragStop","resizeStart","resize","resizeStop",
283 "close"],c=a.ui.jig._getFncFromStr,d=0;d<b.length;d++){var f=b[d],g=this.options[f];if(g){g=c(g);this.options[f]=g}}},getDialogNode:function(){if(typeof this._dialogNode==="undefined"){var b=this._triggerNode.attr("href");if(b&&b!==""&&!this._ajaxable){b=this._triggerNode.prop("hash");this._dialogNode=a(b)}else this._dialogNode=a(this.options.destSelector)}return this._dialogNode},_renderButtonMarkup:function(){this._jigButtons=this.element.find("button,input[type=submit]").addClass("ui-state-default ui-corner-all");
284 if(this._jigButtons.length!==0){this._jigButtons.wrapAll('<div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"></div>');this._doButtonHover()}},_doButtonHover:function(){this._jigButtons.hover(function(){var b=a(this);b.hasClass("ui-state-hover")?b.removeClass("ui-state-hover"):b.addClass("ui-state-hover")})},_ajaxable:function(b){this._href=a.trim(b.attr("href"));b=this._href.replace(window.location.href,"");return b.search(/^#/)===-1&&b!==""?true:false},close:function(){return this.element.dialog.apply(this.element,
285 ["close"])},open:function(){return this.element.dialog.apply(this.element,["open"])},isOpen:function(){return this.element.dialog.apply(this.element,["isOpen"])},widget:function(){return this.element.dialog.apply(this.element,["widget"])},moveToTop:function(){this.getDialogNode().dialog("moveToTop")},option:function(){for(var b=["option"],c=0;c<arguments.length;c++)b.push(arguments[c]);return this.element.dialog.apply(this.element,b)},enable:function(){return this.element.dialog.apply(this.element,
286 ["enable"])},disable:function(){return this.element.dialog.apply(this.element,["disable"])},destroy:function(){this.element.dialog.apply(this.element,["destroy"]).show().removeClass("ui-dialog ui-widget ui-widget-content ui-corner-all").unbind();this._triggerNode.unbind(this.options.openEvent)},_getContent:function(){var b=this._href.split("#");this.element.load(b.length===1?b[0]:b[0]+" #"+b[1],function(){jQuery.ui.jig.scan()})}})})(jQuery);
287 (function(){var a=jQuery.ui.button.prototype._create;jQuery.ui.button.prototype.options.color="ui-ncbibutton-gray";jQuery.ui.button.validColors=["ui-ncbibutton-gray","ui-ncbibutton-copper","ui-ncbibutton-blue"];jQuery.ui.button.classColors=["jig-ncbibutton-gray","jig-ncbibutton-copper","jig-ncbibutton-blue"];var b=function(){a.apply(this,arguments);this._addClasses()};jQuery.widget("ui.ncbibutton",jQuery.ui.button,{_create:function(){b.apply(this,arguments)},_getColor:function(){for(var c=this.options.color,
288 d=this.element[0].className,f=jQuery.ui.button.classColors,g=0;g<f.length;g++)if(d.indexOf(f[g])!==-1){c=jQuery.ui.button.validColors[g];break}if(c.indexOf("ui-ncbibutton-")!==0)c="ui-ncbibutton-"+c;if(jQuery.inArray(c,jQuery.ui.button.validColors)===-1){typeof console!=="undefined"&&console.warn&&console.warn("The color you picked: "+this.options.color+" is not a valid color choice.\n Valid colors: "+jQuery.ui.button.validColors.join(", "));c=jQuery.ui.button.validColors[0]}return c},_addClasses:function(){this.buttonElement.addClass("ui-ncbibutton").addClass(this._getColor()).removeClass("ui-button ui-widget")}})})();
289 (function(){(function(a){jQuery.widget("ui.ncbibuttonset",jQuery.ui.buttonset,{_create:function(){a(".jig-ncbibuttonset").find("label").addClass("ui-ncbibutton").removeClass("ui-button ui-widget")},destroy:function(){a(".jig-ncbibuttonset").find("label").removeClass("ui-ncbibutton")}})})(jQuery)})();
290 jQuery.widget("ui.ncbitabs",jQuery.ui.tabs,{orgCreate:jQuery.ui.tabs.prototype._create,orgTabify:jQuery.ui.tabs.prototype._tabify,orgSelect:jQuery.ui.tabs.prototype.select,_create:function(){var a=this;this.allTab=this.getAllTab();if(isAllTab=this.allTab.length>0){jQuery("#"+this.allTab.attr("href").substr(1)).hide();jQuery(this.element.children("ul")[0]).find("a").each(function(){jQuery(this).data("ncbitab-origHref",jQuery(this).prop("href"))})}this.orgCreate();if(isAllTab){jQuery(this.element.find(".ui-tabs-nav > li")[this.options.selected]).find("a")[0]==
291 this.allTab[0]&&this._doAllTab();this.allTab.on({click:function(){a._doAllTab()},focus:function(){a._doAllTab()},keypress:function(){a._doAllTab()}})}this._addRolesAndInitTabIndex();a=this;jQuery(this.element.children("ul")[0]).find("a").not(a.allTab).bind("click.ncbitabs",function(){a.element.removeClass("ui-tabs-all-selected");a.element.find(".ui-tabs-panel").removeClass("ui-tabs-panel-internal")})},destroy:function(){jQuery(this.element.children("ul")[0]).find("a").removeData("ncbitab-origHref");
292 jQuery(this.element).find(".ui-tabs-panel").removeClass("ui-tabs-panel-internal");jQuery(this.element).removeClass("ui-tabs-all-selected");jQuery(this.element.children("ul")[0]).find("a").unbind("click.ncbitabs");jQuery.ui.tabs.prototype.destroy.apply(this,arguments);this._removeRolesAndTabIndex()},_doAllTab:function(){var a=this;a.element.addClass("ui-tabs-all-selected");a.element.find(".ui-tabs-panel").each(function(){var b=jQuery(this);if(jQuery.trim(b.html())===""||!a.options.cache){var c=a.element.find(".ui-tabs-nav a[href=#"+
293 b.attr("id")+"]").data("ncbitab-origHref");c.search(/#.+$/)==-1&&jQuery.get(c,function(d){b.html(d)})}b.not(":last-child").addClass("ui-tabs-panel-internal");b.removeClass("ui-tabs-hide")})},getAllTab:function(){ret=null;this.element.children("ul").find("a").each(function(){var a=jQuery(this);if(a.text().toLowerCase()==="all")ret=a});ret||(ret=this.element.find("a.ui-ncbitabs-all"));return ret},_tabify:function(a){this.orgTabify(a);var b=this;this.element.find("ul.ui-tabs-nav a").on("keydown click",
294 function(c){jQuery(c.target).focus();c=c.keyCode;var d=jQuery.ui.keyCode,f=function(i,e){i=jQuery(i);nDom=i[0];nDom.tabIndex=0;nDom.focus();e&&jQuery(e).each(function(){if(this!==nDom)this.tabIndex=-1})};if(c===d.RIGHT){var g=b.select(b.getNextTabIndex())[0];f(g,b.anchors)}if(c===d.LEFT){g=b.select(b.getPreviousTabIndex())[0];f(g,b.anchors)}})},_addRolesAndInitTabIndex:function(){var a=function(c,d){var f=c.attr("role");f&&c.data("ncbitab-origRole",f);c.attr("role",d)},b=this.element.children("ul").siblings("div").each(function(){a(jQuery(this),
295 "tabpanel")}).end();a(b,"tablist");b.children("li").each(function(){a(jQuery(this),"presentation")}).find("a").each(function(c){a(jQuery(this),"tab");this.tabIndex=c>0?-1:0})},_removeRolesAndTabIndex:function(){var a=function(c){var d=c.data("ncbitab-origRole");d?c.attr("role",d):c.removeAttr("role")},b=this.element.children("ul").siblings("div").each(function(){a(jQuery(this))}).end();a(b);b.children("li").each(function(){a(jQuery(this))}).find("a").each(function(){a(jQuery(this));jQuery(this).removeAttr("tabIndex")})},
296 select:function(a){this.orgSelect.apply(this,[a]);return this.anchors.eq(a)},getCurrentTabIndex:function(){var a=null;this.element.find("ul.ui-tabs-nav").children("li").each(function(b){if(jQuery(this).hasClass("ui-tabs-selected")){a=b;return false}});return a},getNextTabIndex:function(){var a=this.anchors,b=this.getCurrentTabIndex();return b===a.length-1?0:b+1},getPreviousTabIndex:function(){var a=this.anchors,b=this.getCurrentTabIndex();return b===0?a.length-1:b-1}});
297 jQuery.widget("ui.ncbigrid",{options:{isScrollable:false,height:"10em",hortScrollbarEnabled:false,width:null,isPageable:false,currentPage:1,isPageToolbarHideable:true,pageSize:10,isSortable:false,columnTypes:[],sortFunctions:[],isPresorted:false,sortColumn:-1,sortColumnDir:1,sortRowIndex:0,titleAscending:"sort ascending",titleDescending:"sort descending",ariaLabelAscending:"activate to sort column ascending",ariaLabelDescending:"activate to sort column descending",checkboxToolbarEnabled:false,filterToolbarEnabled:false,
298 filterToolbarIsCaseInsensitive:null,filterToolbarColumnIndex:null,filterToolbarIsInverse:null,isLoadingMessageShown:true,loadingText:"Loading",collapseRowsEnabled:false},_init:function(){},_create:function(){this._isStartPageOne=this.options.currentPage===1;this._wrapTable();this._addBasicStyles();this._checkIfCSSIsScrollable();this._attachLoadingMessageListener();if(this.options.isScrollable||this.options.isSortable||this.options.isPageable||this.options.checkboxToolbarEnabled||this.options.filterToolbarEnabled)this._addAriaRolesAndStates();
299 this._addRowClickWatcher();this.options.isScrollable&&this._createScrollable();if(this.options.isPageable||this.options.isPagable){this.options.isPageable=true;this._createPageGrid()}if(this.options.isSortable){this._createSortGrid();this.updateAriaTH()}else this._enableCollapseTbodyRows();this.options.checkboxToolbarEnabled&&this._createCheckboxSelectors();this.options.filterToolbarEnabled&&this._createFilterBarControl();this._addRowHoverEvent()},destroy:function(){console.info("called destroy from grid");
300 jQuery.Widget.prototype.destroy.apply(this,arguments);this.options.isScrollable&&this._destroyScrollable();if(this.options.isPageable||this.options.isPagable)this._destroyPageGrid();this._destroyRowHoverEvent()},_addBasicStyles:function(){this.element.addClass("ui-ncbigrid").attr("cellpadding","0").attr("cellspacing","0")},_checkIfCSSIsScrollable:function(){if(this.element.hasClass("jig-ncbigrid-scroll"))this.options.isScrollable=true},_wrapTable:function(){var a=this.element.parent().parent();if(!a.hasClass("ui-ncbigrid-outer-div")){this.element.wrap('<div class="ui-ncbigrid-outer-div"><div class="ui-ncbigrid-inner-div"></div></div>');
301 a=this.element.parent().parent()}this.element.find("caption").length>0&&a.addClass("caption-exists");var b=this.options.width;b&&a.css("width",b)},_addRowHoverEvent:function(){jQuery(this.element).on("mouseenter","tbody > tr",function(){var a=jQuery(this);a.hasClass("ignoreHoverHighlight")||a.addClass("ui-ncbigrid-row-hover")}).on("mouseleave","tbody > tr",function(){jQuery(this).removeClass("ui-ncbigrid-row-hover")})},_destroyRowHoverEvent:function(){jQuery(this.element).off("mouseenter mouseleave",
302 "tr")},_addAriaRolesAndStates:function(){var a=this.element;a.attr("id")||a.attr("id",jQuery.ui.jig._generateId(this.widgetName));a.parent().parent().attr("role","grid").attr("tabindex","0");a.children("thead").children("tr").attr("role","row").children("th").attr({"aria-controls":a.attr("id"),role:"columnheader",tabindex:"0"});a.children("tbody").attr({role:"alert","aria-live":"polite","aria-relevant":"text"})},updateAriaTH:function(){if(this.options.isSortable){var a=this;this.element.parent().parent().find("div, table").attr("tabindex",
303 "0").end().find("thead").find("th").each(function(b,c){b="";var d=a.options.ariaLabelAscending;if(jQuery(c).is(".sortDsc")){b="descending";d=a.options.ariaLabelAscending}else if(jQuery(c).is(".sortAsc")){b="ascending";d=a.options.ariaLabelDescending}c=jQuery(c).children("a");jQuery(c).attr("aria-label",jQuery(c).text()+": "+d);b==""?jQuery(c).removeAttr("aria-sort"):jQuery(c).attr("aria-sort",b)})}},_createScrollable:function(){this._storeRefs();this._addScrollClasses();this._copyCaptionHeader();
304 this._setWidthHeight();this._setWidths();this._registerScrollableListeners()},_destroyScrollable:function(){this._removeScrollClasses();if(this.parts){this.parts.scrollWrapper.removeClass("ui-ncbigrid-scroll");this.parts.headerWrapper.remove();for(var a in this.parts)this.parts[a]=null;this.parts=null}this._windowResize&&jQuery(window).unbind("resize",this._windowResize)},_storeRefs:function(){var a=this.element;this.parts={table:a,ths:a.find("> thead th")}},_addScrollClasses:function(){var a=this.element,
305 b=a.parent().addClass("ui-ncbigrid-scroll");this.parts.scrollWrapper=b;if(jQuery.browser.webkit){var c=navigator.userAgent;c.indexOf("AppleWebKit")>0&&c.indexOf("Chrome")==-1&&a.addClass("safari")}this.options.hortScrollbarEnabled&&b.addClass("ui-ncbigrid-hort-scroll")},_removeScrollClasses:function(){this.element.removeClass("ui-ncbigrid").removeClass("safari").parent().removeClass("ui-ncbigrid-scroll")},_copyCaptionHeader:function(){var a=this.element,b=a.parent();b.parent();var c=a.find("caption").clone();
306 a=a.find("> thead").clone();c=jQuery("<div class='ui-ncbigrid-header-wrapper'></div>").append("<table cellpadding='0' cellspacing='0' class='ui-ncbigrid ui-ncbigrid-header'></table>").find("table").append(c).append(a).end();c.insertBefore(b);b=c.find("caption");b.wrapInner("<div></div>");this.parts.captionDiv=b.find("div");this.parts.headerWrapper=c;this.parts.headerThs=c.find("thead th")},_setWidthHeight:function(){this.options.height!==null&&this.parts.scrollWrapper.height(this.options.height)},
307 _setWidths:function(){function a(j){jQuery(this).width(h[j])}var b=this.parts,c=b.table,d=b.ths,f=b.scrollWrapper,g=b.headerWrapper;b=b.headerThs;var i=jQuery.browser.msie;if(!this.options.hortScrollbarEnabled&&c.data("isMinSet")!==true&&this.element.is(":visible")){var e=c.outerWidth();if(c.width()>f.width()){f.css("min-width",e+16);c.data("isMinSet",true)}}var h=[];d.each(function(){var j=jQuery(this),k=0;if(j.is(":visible")){k=0;if(i)k=(j.outerWidth()-j.width())/2;k=jQuery(this).width()+k}h.push(k)});
308 d=c.height()>f.height()?16:0;e=this.options.isSortable&&i&&parseInt(jQuery.browser.version,10)<8?d:0;c.parent().parent().find("table.ui-ncbigrid-header").width(c.width()+2-e);c=f.width()-d;g.width(c);this.parts.captionDiv&&this.parts.captionDiv.width(c);b.each(a)},_handleScroll:function(a,b,c){function d(){g._handleScroll(a,b,true)}var f=a.scrollLeft;b.scrollLeft=f;this.parts.captionDiv&&this.parts.captionDiv.css("margin-left",f+"px");var g=this;if(!c){window.setTimeout(d,1);window.setTimeout(d,5)}},
309 _registerScrollableListeners:function(){var a=this;this._windowResize=function(){a._setWidths()};jQuery(window).resize(this._windowResize);var b=this.element.parent().parent().find(".ui-ncbigrid-header-wrapper")[0];this.element.parent().scroll(function(){a._handleScroll(this,b)});this.element.bind("ncbigridupdated",function(){a._setWidths()});this.element.bind("resetScroll",function(){a._resetScrollToTop()})},_resetScrollToTop:function(){this.parts.scrollWrapper.scrollTop(0)},_createPageGrid:function(){this._createPageBars();
310 this._addPagingEvents();this._gotoPage(this.options.currentPage)},_destroyPageGrid:function(){if(this._pageBars){this._removePagingEvents();this._removePageBars()}},_pagingControlsHTML:'                                         <div class="ui-ncbigrid-paged-toolbar">                                                <div class="ui-ncbigrid-paged-countItems">Items <span class="ui-ncbigrid-paged-startRow">1</span> - <span class="ui-ncbigrid-paged-endRow">10</span> of <span class="ui-ncbigrid-paged-totalRows">10</span></div>                                                <div class="ui-ncbigrid-paged-pageControl pagination">                        <a href="#" class="ui-ncbigrid-paged-pageControl-first page_link" title="Goto First Page">&lt;&lt; First</a>                        <span class="ui-ncbigrid-paged-pageControl-first page_link" title="Inactive Goto First Page">&lt;&lt; First</span>                        <a href="#" class="ui-ncbigrid-paged-pageControl-previous page_link prev" title="Goto Previous Page">&lt; Prev</a>                        <span class="ui-ncbigrid-paged-pageControl-previous page_link prev" title="Inactive Goto Previous Page">&lt; Prev</span>                        <label>Page</label> <input type="text" value="1" size="2" title="current page number"/> of <span class="ui-ncbigrid-paged-endPage">2</span>                        <a href="#" class="ui-ncbigrid-paged-pageControl-next next page_link" title="Goto Next Page">Next &gt;</a>                        <span class="ui-ncbigrid-paged-pageControl-next next page_link" title="Inactive Goto Next Page">Next &gt;</span>                        <a href="#" class="ui-ncbigrid-paged-pageControl-last page_link" title="Goto Last Page">Last &gt;&gt;</a>                        <span class="ui-ncbigrid-paged-pageControl-last page_link" title="Inactive Goto Last Page">Last &gt;&gt;</span>                        </div>                                            </div>',
311 _createPageBars:function(){this._pageToolBar_top=jQuery(this._pagingControlsHTML).addClass("ui-ncbigrid-paged-toolbar-top");this._pageToolBar_bottom=jQuery(this._pagingControlsHTML).addClass("ui-ncbigrid-paged-toolbar-bottom");var a=this.element,b=a.parent().parent();b.prepend(this._pageToolBar_top);b.append(this._pageToolBar_bottom);b.children(".ui-ncbigrid-paged-toolbar-top").children(".ui-ncbigrid-paged-countItems").attr("id",jQuery.ui.jig._generateId("ui-ncbigrid-paged-countItems"));a.attr("aria-describedby",
312 this._pageToolBar_top.children(".ui-ncbigrid-paged-countItems").attr("id"));this._pageBars=this._pageToolBar_top.add(this._pageToolBar_bottom);this._pageBars.find(":input").each(function(c,d){jQuery(d).attr("id",jQuery.ui.jig._generateId("ui-ncbigrid-paged-current-page")).prev().attr("for",jQuery(d).attr("id"))})},_removePageBars:function(){this._pageToolBar_top.remove();this._pageToolBar_top=null;this._pageToolBar_bottom.remove();this._pageBars=this._pageToolBar_bottom=null;this.element.removeAttr("aria-describedby")},
313 _addPagingEvents:function(){var a=this,b=this._pageBars.find("a.ui-ncbigrid-paged-pageControl-first"),c=this._pageBars.find("a.ui-ncbigrid-paged-pageControl-previous"),d=this._pageBars.find("a.ui-ncbigrid-paged-pageControl-next"),f=this._pageBars.find("a.ui-ncbigrid-paged-pageControl-last"),g=this._pageBars.find("input");b.click(function(i){a.gotoFirstPage();i.preventDefault()});c.click(function(i){a.gotoPrevPage();i.preventDefault()});d.click(function(i){a.gotoNextPage();i.preventDefault()});f.click(function(i){a.gotoLastPage();
314 i.preventDefault()});g.keypress(function(i){if(i.keyCode===13){a.gotoPage(this.value);i.preventDefault()}})},_removePagingEvents:function(){this._pageBars.find("a").unbind("click").end().find("input").unbind("keypress")},_showHidePageToolbar:function(){if(this._pageBars)if(this.options.isPageToolbarHideable)this.getRowCount()<=this.options.pageSize?this._pageBars.hide():this._pageBars.show()},_setPage:function(){this.element.trigger("resetScroll");this.element.trigger("pagechanged");var a=this._getCurrentPage(),
315 b=this.getMaxPage();this._showHidePageToolbar();this._updateRows(a,b);this._updateButtons(a,b);this._updatePagingText(a,b);this._updateGoto(a,b);this._updateItemRange(a,b);this._pageBars.find(".ui-ncbigrid-paged-pageControl").attr({"aria-valuemin":"1","aria-controls":this.element.attr("id"),"aria-valuemax":b,"aria-valuenow":a});this._notifyGridUpdated()},_updateRows:function(a){var b=this.options.pageSize,c=this.getRowCount();a=(a-1)*b;var d=a+b;b=this.element.find("> tbody > tr:not(.ncbigrid-row-filtered)");
316 var f=this.element.find("> tbody").length>1,g=0;if(f&&a>0)g=b.filter(":lt("+a+")").filter(":has(th)").length;var i="";if(d<c)i+=":lt("+(d+g)+")";if(a>0)i+=":gt("+(a-1+g)+")";c=b;if(i.length>0){b.not(".ui-ncbigrid-rowHidden").addClass("ui-ncbigrid-rowHidden");c=b.filter(i)}c.removeClass("ui-ncbigrid-rowHidden");if(f){a=c.filter(":has(th)").length;if(a>0){b=0;for(c=c.last().next();b<a&&c.length===1;){if(!c.hasClass("ncbigrid-row-filtered")){c.has("th")||b++;c.removeClass("ui-ncbigrid-rowHidden")}c=
317 c.next()}}}this._notifyGridUpdated()},_updateButtons:function(a,b){var c=b===2,d=a===1,f=this._pageBars.find("a.ui-ncbigrid-paged-pageControl-previous,a.ui-ncbigrid-paged-pageControl-first").css("display",d?"none":"inline").filter("a.ui-ncbigrid-paged-pageControl-first");d=this._pageBars.find("span.ui-ncbigrid-paged-pageControl-previous,span.ui-ncbigrid-paged-pageControl-first").css("display",d?"inline":"none").filter("span.ui-ncbigrid-paged-pageControl-first");b=a===b||b==0;a=this._pageBars.find("a.ui-ncbigrid-paged-pageControl-next,a.ui-ncbigrid-paged-pageControl-last").css("display",
318 b?"none":"inline").filter("a.ui-ncbigrid-paged-pageControl-last");b=this._pageBars.find("span.ui-ncbigrid-paged-pageControl-next,span.ui-ncbigrid-paged-pageControl-last").css("display",b?"inline":"none").filter("span.ui-ncbigrid-paged-pageControl-last");c&&f.add(d).add(a).add(b).css("display","none")},_updatePagingText:function(a,b){if(b<1)b=1;this._pageBars.find("div.ui-ncbigrid-paged-pageControl").find("span.ui-ncbigrid-paged-endPage").html(b)},_updateGoto:function(a){this._pageBars.find("input").val(a)},
319 _updateItemRange:function(a){var b=parseInt(this.options.pageSize,10),c=this.getRowCount();a=(a-1)*b+1;b=a+b-1;if(b>c)b=c;if(c==0)a=0;var d=this._pageBars.find("div.ui-ncbigrid-paged-countItems");d.find("span.ui-ncbigrid-paged-startRow").html(a);d.find("span.ui-ncbigrid-paged-endRow").html(b);d.find("span.ui-ncbigrid-paged-totalRows").html(c)},_getCurrentPage:function(){return this.options.currentPage},getCurrentPage:function(){return this._getCurrentPage()},getMaxPage:function(){return Math.ceil(this.getRowCount()/
320 this.options.pageSize)},getRowCount:function(){return jQuery(this.element).find("> tbody > tr:not(.ncbigrid-row-filtered):not(:has(> th))").length},getHeaderRowCount:function(){return jQuery(this.element).find("tbody > tr:has(th)").length},gotoFirstPage:function(){this._gotoPage(1)},gotoLastPage:function(){this._gotoPage(this.getMaxPage())},gotoNextPage:function(){this._gotoPage(this._getCurrentPage()+1)},gotoPrevPage:function(){this._gotoPage(this._getCurrentPage()-1)},gotoPage:function(a){this._gotoPage(parseInt(a,
321 10))},_gotoPage:function(a){if(isNaN(a)||a<1)a=1;else if(a>this.getMaxPage()){a=this.getMaxPage();if(a<1)a=1}this.options.currentPage=a;this._pagingSelectAllQuestions&&this._pagingSelectAllQuestions.hide();this._setPage()},_createSortGrid:function(){var a=this.options.sortColumn;if(this.options.sortColumn!==-1){a=a-1;this.options.sortColumn=a!==-1?a:0}this._indexGrid();this._addSortEvents();this._setSortHeaders();this._checkInitialState();this._notifyGridUpdated()},_destroySortGrid:function(){},reindex:function(){for(var a=
322 0;a<this.element.find("tbody tr:eq(0) td").length;a++)this.element.data("sort_order_col_"+a,null);this.element.data("rows",null);this._indexGrid()},_indexGrid:function(){var a=this,b=this.element.find("> tbody");if(b.length===0)this._isIndexed=false;else for(var c=0;c<b.length;c++)(function(d,f){function g(){for(var s=0;s<50&&l<n;s++){var r=k[l],v=a.getRowValues_DOM(r);if(v.length==0){a._enableCollapseTbodyRows(r);e.push(r);j++}else{v.unshift(l-j,r);i.push(v);h.push(v)}l++}if(l<n)window.setTimeout(g,
323 0);else{a.element.data("tbody"+f+"-rows",h);a.element.data("tbody"+f+"-header",e);a._presort(i,f)}}var i=[],e=[],h=[],j=0,k=jQuery(d).find("> tr"),l=0,n=k.length;if(n===0)a._isIndexed=false;else{a._isIndexed=true;g()}})(b[c],c)},_presort:function(a,b){function c(h){var j=g.options.sortFunctions[h-2];j||(j=g.element.find("> thead th:eq("+(h-2)+")").data("sortfunc"));if(j)if(typeof j==="function")return j;else if(j.indexOf("fnc:")===0){j=j.substr(4,j.length).split(".");for(var k=window[j[0]],l=1;l<
324 j.length;l++)k=k[j[l]];return g.options.sortFunctions[h]=k}return null}function d(h,j,k){function l(q){if(q.length<2)return q;var m=parseInt(q.length/2),p=q.slice(0,m);q=q.slice(m,q.length);return n(l(p),l(q))}function n(q,m){for(var p=[];q.length&&m.length;){var u=false;(u=s?-g.options.sortColumnDir==s.call(g,{data:q[0][j],row:jQuery(q[0][1])},{data:m[0][j],row:jQuery(m[0][1])}):q[0][j]<=m[0][j])?p.push(q.shift()):p.push(m.shift())}for(;q.length;)p.push(q.shift());for(;m.length;)p.push(m.shift());
325 return p}var s=c(j),r=jQuery.browser.msie?100:1E3,v=0,o=[];(function(){for(var q=0;q<r&&v<h.length;q++){o.push(h[v]);v++}v<h.length?setTimeout(arguments.callee,0):k(l(o),j)})()}function f(h,j){var k=0,l=[];(function(){for(var n=0;n<50&&k<h.length;n++){l.push(h[k][0]);k++}k<h.length?setTimeout(arguments.callee,0):g.element.data("tbody"+b+"-sort_order_col_"+(j-2),l)})()}for(var g=this,i=a[0].length,e=2;e<i;e++)this._getColumnType(e-2)!=="none"&&d(a,e,f)},_getColumnType:function(a){var b=this.options.columnTypes[a];
326 b||(b=this.element.find("> thead th:eq("+a+")").data("columntype"));return b||"str"},getColumnType:function(a){return this._getColumnType(a-1)},getRowValues:function(a){if(typeof a==="number")a=this.element.find("tbody tr:eq("+a+")");var b=[];a=a[0].getElementsByTagName("td");for(var c=a.length,d=0;d<c;d++)b.push(this._getCellValueHelper(a[d].innerHTML,d));return b},getRowValues_DOM:function(a){var b=[];a=jQuery(a).children("td");for(var c=a.length,d=0;d<c;d++)b.push(this._getCellValueHelper(a[d].textContent||
327 a[d].innerText||"",d));return b},_getCellValue:function(a,b){return this._getCellValueHelper(a.html(),b)},_getCellValueHelper:function(a,b){var c=this._getColumnType(b);switch(c){case "num":case "number":case "float":return a!==undefined&&a.length>0?parseFloat(a):Number.POSITIVE_INFINITY;case "int":return a!==undefined&&a.length>0?parseInt(a,10):Number.POSITIVE_INFINITY;case "numberComma":case "numComma":a=(a||"").replace(/[, ]/g,"");return a.length>0?parseFloat(a):Number.POSITIVE_INFINITY;case "date":return new Date(a);
328 case "str-insensitive":return a.toLowerCase();case "str":default:if(typeof c==="function")return c(a);else if(c.indexOf("fnc:")===0){c=c.substr(4,c.length).split(".");for(var d=window[c[0]],f=1;f<c.length;f++)d=d[c[f]];this.options.columnTypes[b]=d;return d(a)}else return a||""}},getCellValue:function(a,b){if(typeof a==="number")a=this.element.find("tbody tr:eq("+a+")");return this._getCellValue(a.find("td:eq("+b+")"),b)},_addSortEvents:function(){function a(f){b._getColumnType(f)!=="none"&&jQuery(this).wrapInner(d).find("a").data("index",
329 f)}var b=this,c=this.element.find("> thead tr:eq("+this.options.sortRowIndex+") th");this.element.bind("ncbigridcontentchanged",function(){b.reindex()});var d="<a href='#' title='"+this.options.titleAscending+"'></a>";c.each(a);c=c;if(this.parts&&this.parts.headerThs){this.parts.headerThs.each(a);c=c.add(this.parts.headerThs)}c.find("a").click(function(f){b._sort(jQuery(this).data("index"));f.preventDefault()})},sort:function(a,b){this._sort(a-1,b)},_sort:function(a,b){if(this._isIndexed){this.options.isPageable&&
330 this.element.trigger("resetCheckboxes");var c=b;if(b===undefined)c=this.options.sortColumn!==a?1:-1*this.options.sortColumnDir;this.options.sortColumn=a;this.options.sortColumnDir=c;this.element.trigger("ncbigridshowloadingbar");this._setSortHeaders();this._waitForCache()}},_setSortHeaders:function(){var a=this.element.find("> thead tr:eq("+this.options.sortRowIndex+") th"),b=null;if(this.parts&&this.parts.headerThs)b=this.parts.headerThs;a.add(b).removeClass("sortAsc sortDsc").addClass("sortNone").find("a").attr("title",
331 this.options.titleAscending);var c=this.options.sortColumn;if(this.options.sortColumn!==-1){var d=this.options.sortColumnDir===1?"sortAsc":"sortDsc",f=this.options.sortColumnDir===1?this.options.titleDescending:this.options.titleAscending;a.eq(c).addClass(d).removeClass("sortNone").find("a").attr("title",f);b&&b.eq(c).addClass(d).removeClass("sortNone").find("a").attr("title",f)}this.options.isSortable&&this.updateAriaTH()},_waitForCache:function(){for(var a=this,b=this.options.sortColumn,c=this.element.find("tbody"),
332 d=0;d<c.length;d++)(function(f){var g=a.element.data("tbody"+f+"-sort_order_col_"+b);if(g)a._setTheRows(g,f);else{var i=arguments.callee;setTimeout(function(){i(f)},10)}})(d)},_setTheRows:function(a,b){var c=this.element.data("tbody"+b+"-header"),d=this.element.data("tbody"+b+"-rows");b=this.element.find("tbody:eq("+b+")");var f=jQuery("<tbody>"),g=c.length;if(g>0)for(var i=0;i<g;i++)f.append(c[i]);if(this.options.sortColumnDir==1)for(i=0;i<a.length;i++){c=d[a[i]][1];f.append(c)}else for(i=a.length-
333 1;i>=0;i--){c=d[a[i]][1];f.append(c)}b.replaceWith(f);this.element.trigger("ncbigridhideloadingbar");if(this.options.isPageable)if(this._isStartPageOne)this.gotoFirstPage();else{this._gotoPage(this.options.currentPage);this._isStartPageOne=true}this.element.trigger("ncbigridcolumnsorted",[this.options.sortColumn+1,this.options.sortColumnDir])},_checkInitialState:function(){!this.options.isPresorted&&this.options.sortColumn!==-1&&this._sort(this.options.sortColumn,this.options.sortColumnDir)},_checkboxControlsHTML:'                                         <div class="ui-ncbigrid-checkbox-toolbar">                        \t\t\t\t\t\t<label>Select:</label>\t\t\t\t\t\t<a href="#" class="ui-ncbigrid-select-all">All</a>\t\t\t\t\t\t<a href="#" class="ui-ncbigrid-select-none">None</a>\t\t\t\t\t\t<label>Selected:</label>\t\t\t\t\t\t<span class="ui-ncbigrid-selected-text">0</span>                                            </div>',
334 _pagingSelectAllQuestionHTML:'<div class="ui-ncbigrid-select-question">All <span class="ui-ncbigrid-select-row-count">10</span> items on this page are <span class="selectText1">selected</span>. <a href="#" class="ui-ncbigrid-select-question-all"><span class="selectText2">Select</span> all rows in table</a> <a href="#" class="ui-ncbigrid-select-question-cancel">Cancel</a></div>',_createCheckboxSelectors:function(){this._createCheckboxBar();this._addCheckboxEvents();this._updateCount()},_createCheckboxBar:function(){this._checkboxToolBar_top=
335 jQuery(this._checkboxControlsHTML).addClass("ui-ncbigrid-checkbox-toolbar-top");this._checkboxToolBar_bottom=jQuery(this._checkboxControlsHTML).addClass("ui-ncbigrid-checkbox-toolbar-bottom");var a=this.element.parent().parent();a.prepend(this._checkboxToolBar_top);if(this.options.isPageable){this._checkboxToolBar_bottom.insertBefore(this._pageToolBar_bottom);this._addSelectAllQuestionToolbar()}else a.append(this._checkboxToolBar_bottom);a.find(".ui-ncbigrid-checkbox-toolbar").attr("aria-controls",
336 this.element.attr("id"));this._chekboxBars=this._checkboxToolBar_top.add(this._checkboxToolBar_bottom)},_addCheckboxEvents:function(){var a=this;this._chekboxBars.find("a.ui-ncbigrid-select-all").click(function(b){a.checkAll();a._askSelectAllQuestion();b.preventDefault()});this._chekboxBars.find("a.ui-ncbigrid-select-none").click(function(b){a.uncheckAll();a._askSelectAllQuestion(true);b.preventDefault()});jQuery(this.element).on("click","tbody",function(b){a._rowClicked(b)});this.element.bind("resetCheckboxes",
337 function(){a.uncheckAll()});this._addSelectAllQuestionToolbarEvents()},_addSelectAllQuestionToolbar:function(){if(this.options.checkboxToolbarEnabled){this._pagingSelectAllQuestion_top=jQuery(this._pagingSelectAllQuestionHTML).addClass("ui-ncbigrid-select-question-header");this._pagingSelectAllQuestion_bottom=jQuery(this._pagingSelectAllQuestionHTML).addClass("ui-ncbigrid-select-question-footer");this._pagingSelectAllQuestion_top.insertAfter(this._pageToolBar_top);this._pagingSelectAllQuestion_bottom.insertAfter(this._pageToolBar_bottom);
338 this._pagingSelectAllQuestions=this._pagingSelectAllQuestion_top.add(this._pagingSelectAllQuestion_bottom);this._pagingSelectAllQuestions.find(".ui-ncbigrid-select-question-all").attr("aria-controls",this.element.attr("id"))}},_addSelectAllQuestionToolbarEvents:function(){if(this.options.checkboxToolbarEnabled){var a=this;this._pagingSelectAllQuestions.find("a.ui-ncbigrid-select-question-all").click(function(b){a[a._askAllSelectionMode](true);a._pagingSelectAllQuestions.hide();b.preventDefault()});
339 this._pagingSelectAllQuestions.find("a.ui-ncbigrid-select-question-cancel").click(function(b){a._pagingSelectAllQuestions.hide();b.preventDefault()});this.element.bind("ncbigridpagechanged checkboxrowclicked",function(){a._pagingSelectAllQuestions&&a._pagingSelectAllQuestions.hide()})}},_askSelectAllQuestion:function(a){this._askAllSelectionMode=a?"uncheckAll":"checkAll";if(this.options.isPageable)if(this.getRowCount()>=this.options.pageSize){this._pagingSelectAllQuestions.show();this._updateSelectPageCount(a)}else this._pagingSelectAllQuestions.hide()},
340 _updateSelectPageCount:function(a){var b=this.element.find("> tbody > tr > td > input[type=checkbox]:visible").length;this._pagingSelectAllQuestions.find(".ui-ncbigrid-select-row-count").html(b);this._pagingSelectAllQuestions.find(".selectText1").html(a?"deselected":"selected");this._pagingSelectAllQuestions.find(".selectText2").html(a?"Deselect":"Select")},_updateCount:function(){var a=this.element.find("tbody input[type=checkbox]");a=a.length>0?a.filter(":checked").length:this.element.find("tbody tr.ui-ncbigrid-row-selected").length;
341 this._chekboxBars.find("span.ui-ncbigrid-selected-text").html(a)},_checkHelper:function(a,b){if(b){b=jQuery(this.element).find("> tbody > tr:not(.ncbigrid-row-filtered) > td > input[type=checkbox]");this._trigger(a?"checkall":"uncheckall",null,[a]);this._checkAllState=a}else b=a&&this.options.isPageable?this.element.find("> tbody > tr > td > input[type=checkbox]:visible"):this.element.find("> tbody > tr > td >  input[type=checkbox]");b.attr("checked",a);b=b.length===0?this.element.find("tbody tr").data("row-selected",
342 a):b.closest("tr");a?b.addClass("ui-ncbigrid-row-selected"):b.removeClass("ui-ncbigrid-row-selected");this._updateCount()},checkAll:function(a){this._checkHelper(true,a);this._trigger("selectallclicked",null,[{acrossAllPages:a}])},uncheckAll:function(a){this._checkHelper(false,a);this._trigger("selectnoneclicked",null,[{acrossAllPages:a}])},_rowClicked:function(a){var b=jQuery(a.target||a.srcElement);a=null;if(b.is("input[type=checkbox]")){a=b;var c=a.is(":checked")}else if(!b.is("a")){a=b.closest("tr").find("input[type=checkbox]");
343 c=!a.is(":checked");a.attr("checked",c)}b=b.closest("tr");if(a&&a.length===0){c=!b.data("row-selected");b.data("row-selected",c)}c?b.addClass("ui-ncbigrid-row-selected"):b.removeClass("ui-ncbigrid-row-selected");this.element.trigger("checkboxrowclicked");this._updateCount()},_filterBarControlsHTML:'                                         <div class="ui-ncbigrid-filter-toolbar">                        \t\t\t\t\t\t\t<label>Filter:</label>\t\t\t\t\t\t\t<input type="text" name="gridFilter" />                                            </div>',
344 _createFilterBarControl:function(){this._createFilterBar();this._addFilterEvents()},_createFilterBar:function(){this._filterToolBar=jQuery(this._filterBarControlsHTML);var a=this.element.parent().parent();a.prepend(this._filterToolBar).children(".ui-ncbigrid-filter-toolbar").attr("aria-controls",this.element.attr("id"));a.addClass("filterToolbar-exists");var b=jQuery.ui.jig._generateId("gridFilter");a.children(".ui-ncbigrid-filter-toolbar").children(":input").attr("id",b).prev().attr("for",b)},_addFilterEvents:function(){var a=
345 this;this._filterToolBar.find("input[type=text]").keyup(function(b){a._filterGrid(b,this)})},_filterGrid:function(a,b){if(!this._lastRunFilter)this._lastRunFilter="";a=b.value;b=this.options.filterToolbarIsCaseInsensitive||null;var c=this.options.filterToolbarColumnIndex||null,d=this.options.filterToolbarIsInverse||null;this._lastRunFilter.length>0&&a.indexOf(this._lastRunFilter)!==0&&this.removeFilterRows();this._lastRunFilter=a;this._lastRunFilter.length>0&&this.filterRows(a,b,c,d)},_custFilterCnt:0,
346 filterRows:function(a,b,c,d){function f(){r.options.isPageable&&r._gotoPage(0);r.element.trigger("ncbigridfilterapplied",[a,b,c,g,i]).trigger("ncbigridhideloadingbar");r._notifyGridUpdated()}if(!(typeof a=="undefined"||a.length===0)){this.element.trigger("ncbigridshowloadingbar");if(!jQuery.isArray(a)){orgTxt=a;a=[[a,b,c,d]]}d=i=jQuery("tbody tr:not(.ncbigrid-row-filtered)",this.element);for(var g,i,e=0;e<a.length;e++){var h=a[e],j=h[0],k=h[2],l=h[3];h="";if(typeof k!="undefined"&&k!==null)h=":nth-child("+
347 k+")";l=l?"not-":"";var n="",s=null;if(typeof j==="function"){n="-functionTest";s=this._custFilterCnt;this._custFilterCnt=s+1;s="filter_temp_"+s;jQuery.ui.jig[s]=j;j="jQuery.ui.jig."+s}else if(j.constructor&&j.constructor.toString().indexOf("RegExp")>0)n="-regexp";else if(b)n="-insensitive";i=k!==null?i.find("td"+h+":"+l+"contains"+n+"("+j+")").parent():i.filter(":"+l+"contains"+n+"("+j+")");if(s)jQuery.ui.jig[s]=null}var r=this;if(d){g=d.not(i);var v=g.length,o=0;(function(){for(var q=0;q<20&&o<
348 v;q++){g.eq(o).addClass("ncbigrid-row-filtered").attr("isfiltered","true");o++}o>=v?f():setTimeout(arguments.callee,1)})()}else f()}},removeFilterRows:function(a,b,c,d,f){function g(){if(k){jQuery.ui.jig[k]=null;a=j}n.options.isPageable&&n._gotoPage(0);n.element.trigger("ncbigridfilterremoved",[a,b,c]);n.options.isPageable?n._gotoPage(n.options.currentPage):n._notifyGridUpdated()}var i=null;if(typeof a!="undefined"&&a.length>0){if(typeof d==="undefined")d=true;var e="",h="";if(d||f){e=":not(";h=")"}var j=
349 d="",k=null;if(typeof a==="function"){d="-functionTest";var l=this._custFilterCnt;this._custFilterCnt=l+1;k="filter_temp_"+l;j=jQuery.ui.jig[k]=a;a="jQuery.ui.jig."+k}else if(a.constructor&&a.constructor.toString().indexOf("RegExp")>0)d="-regexp";else if(b)d="-insensitive";f=f?"not-":"";if(typeof c!="undefined"&&c!==null){e="tbody tr[isfiltered='true'] td:nth-child("+c+")"+e+":"+f+"contains"+d+"("+a+")"+h;i=this.element.find(e).parent()}else{e="tbody tr[isfiltered='true']"+e+":contains"+d+"("+a+")"+
350 h;i=this.element.find(e)}}else i=this.element.find("tr.ncbigrid-row-filtered");var n=this;if(i!==null){var s=i.length,r=0;(function(){for(var v=0;v<20&&r<s;v++){i.eq(r).removeClass("ncbigrid-row-filtered").attr("isfiltered","false");r++}r>=s?g():setTimeout(arguments.callee,1)})()}else g()},showColumn:function(a){var b=this.element;if(this.options.isScrollable)b=b.add(this.parts.headerWrapper.find("table"));b.children().find(">tr>*:nth-child("+a+")").removeClass("ui-ncbigrid-column-hidden");this._setColumnHiddenData(a,
351 false);this.element.trigger("showColumn",[a]);this._notifyGridUpdated()},hideColumn:function(a){var b=this.element;if(this.options.isScrollable)b=b.add(this.parts.headerWrapper.find(">table"));b.children().find(">tr>*:nth-child("+a+")").addClass("ui-ncbigrid-column-hidden");this._setColumnHiddenData(a,true);this.element.trigger("hideColumn",[a]);this._notifyGridUpdated()},_setColumnHiddenData:function(a,b){var c=this.element.data("dataHiddenCols");c||(c=[]);c[a]=b;this.element.data("dataHiddenCols",
352 c)},getHiddenShownColumns:function(){var a=[],b=[],c=this.element.data("dataHiddenCols");if(c)for(var d in c)c[d]?a.push(d):b.push(d);return{hidden:a,shown:b}},_attachLoadingMessageListener:function(){var a=this;this.element.bind("ncbigridshowloadingbar",function(){a._showLoadingMessage()}).bind("ncbigridhideloadingbar",function(){a._hideLoadingMessage()})},_showLoadingMessage:function(){if(this.options.isLoadingMessageShown){if(!this.isPopperAttached){this.element.parent().parent().ncbipopper({triggerPosition:"top center",
353 destPosition:"top center",hasArrow:false,closeEvent:"custom",openEvent:"custom",openAnimation:"none",closeAnimation:"none",destText:this.options.loadingText,isDestElementCloseClick:false,isDocumentElementCloseClick:false,isEscapeKeyClose:false,isTriggerElementCloseClick:false});this.isPopperAttached=true}this.element.parent().parent().ncbipopper("open")}},_hideLoadingMessage:function(){this.options.isLoadingMessageShown&&this.element.parent().parent().ncbipopper("close")},_addRowClickWatcher:function(){var a=
354 this;jQuery(this.element).on("click","tbody",function(b){b=jQuery(b.srcElement||b.target).closest("td");if(b.length===1){var c=b.closest("tr");a.element.trigger("ncbigridrowclick",[{row:c,cell:b,rowIndex:c[0].rowIndex,cellIndex:b[0].cellIndex}])}})},_notifyGridUpdated:function(){this.element.trigger("ncbigridupdated")},_notifyGridContentChanged:function(){this.element.trigger("ncbigridcontentchanged")},addHTMLRowData:function(a,b,c,d){var f=this.getRowCount(),g="";if(typeof b=="undefined")g=":last-child";
355 else{if(b>f)b=f;else if(b<0){b=1;c="before"}g=":nth-child("+b+")"}b=d!==undefined?":eq("+d+")":"";if(f===0)jQuery("tbody"+b+g,this.element).append(a);else c&&c.toLowerCase()==="before"?jQuery("tbody"+b+" tr"+g,this.element).before(a):jQuery("tbody"+b+" tr"+g,this.element).after(a);this.options.isPageable?this._gotoPage(this.options.currentPage):this._notifyGridUpdated();this._notifyGridContentChanged()},_deleteRowHelper:function(a,b){b=b!==undefined?":eq("+b+")":"";a?this.element.find("tbody"+b+" tr"+
356 a).remove():this.element.find("tbody"+b).empty()},deleteAllRows:function(){this._deleteRowHelper();this.options.isPageable&&this._gotoPage(0);this._notifyGridUpdated();this._notifyGridContentChanged()},deleteRow:function(a,b){if(typeof a!="undefined"){a=jQuery.isArray(a)?a.sort():[a];for(var c=a.length-1;c>=0;c--)this._deleteRowHelper(":nth-child("+a[c]+")",b);this.options.isPageable&&this._gotoPage(this.options.currentPage);this._notifyGridUpdated();this._notifyGridContentChanged()}},getCellData:function(a,
357 b,c){if(!(typeof a=="undefined"||typeof b=="undefined")){a=jQuery("tbody"+(c!==undefined?":eq("+c+")":"")+" tr:nth-child("+a+") td:nth-child("+b+")",this.element);if(a.length==0)return null;return this._getCellValue(a,b)}},getColumnCount:function(a){a=a===false?":visible":"";a=jQuery(this.element).find("tbody tr:not(.ui-ncbigrid-rowHidden):eq(0) td"+a).length;if(a===0)a=jQuery(this.element).find("> thead tr:last th").length;return a},getColumnData:function(a,b){if(typeof a==="undefined")return null;
358 else if(jQuery.isArray(a)){for(var c=[],d=0;d<a.length;d++){if(a[d]<=0||a[d]>this.getColumnCount())c.push(null);c.push(this._getColumnDataHelper(a[d]),b)}return c}else{if(a<=0||a>this.getColumnCount())return null;return this._getColumnDataHelper(a,b)}},_getColumnDataHelper:function(a,b){var c=[],d=this,f=this._getColumnType(a-1);if(f==="str"||!f)f="str-sensitive";jQuery("tbody"+(b!==undefined?":eq("+b+")":"")+" tr td:nth-child("+a+")",this.element).each(function(g,i){c.push(d._csColumnTypeConversion(i,
359 f,true))});if(c.length!==0)return c},getRowData:function(a,b){if(typeof a!=="undefined")if(jQuery.isArray(a)){for(var c=[],d=0;d<a.length;d++)c.push(this._getRowDataHelper(a[d]),b);return c}else return this._getRowDataHelper(a,b)},_getRowDataHelper:function(a,b){var c=[],d=this;jQuery("tbody"+(b!==undefined?":eq("+b+")":"")+" tr:nth-child("+a+") td",this.element).each(function(f){c.push(d._getCellValue(jQuery(this),f))});if(c.length!==0)return c},highlightRows:function(a,b,c,d){var f=jQuery.browser.msie&&
360 parseFloat(jQuery.browser.version)<7;if(!(typeof a=="undefined"||a.length===0)){this.element.trigger("ncbigridshowloadingbar");var g=[],i=b?"-insensitive":"";d=d?"not-":"";if(a.constructor&&a.constructor.toString().indexOf("RegExp")>0){i="-regexp";d=""}typeof c!="undefined"?jQuery("tbody tr td"+(":nth-child("+c+")")+":"+d+"contains"+i+"("+a+")",this.element).each(function(e,h){e=jQuery(h).parent();h="ui-ncbigrid-high";if(f)h=e.hasClass("ui-ncbigrid-row-even")?"ui-ncbigrid-row-even-high-IE6":"ui-ncbigrid-row-odd-high-IE6";
361 e.addClass(h);jQuery.inArray(e,g)===-1&&g.push(e)}):jQuery("tbody tr:"+d+"contains"+i+"("+a+")",this.element).each(function(e,h){e=jQuery(h);h="ui-ncbigrid-high";if(f)h=e.hasClass("ui-ncbigrid-row-even")?"ui-ncbigrid-row-even-high-IE6":"ui-ncbigrid-row-odd-high-IE6";e.addClass(h);g.push(e)});this.element.trigger("ncbigridhighlightapplied",[a,b,c,g]).trigger("ncbigridhideloadingbar");return{highlightedRows:g}}},removeHighlightRows:function(a,b,c,d){var f=jQuery.browser.msie&&parseFloat(jQuery.browser.version)<
362 7;if(typeof a!="undefined"&&a.length>0){var g=[],i=b?"-insensitive":"";d=d?"not-":"";if(a.constructor&&a.constructor.toString().indexOf("RegExp")>0){i="-regexp";d=""}typeof c!="undefined"?jQuery("tbody tr td"+(":nth-child("+c+")")+":"+d+"contains"+i+"("+a+")",this.element).each(function(e,h){e=jQuery(h).parent().removeClass("ui-ncbigrid-high");f&&e.removeClass("ui-ncbigrid-row-odd-high-IE6").removeClass("ui-ncbigrid-row-even-high-IE6");jQuery.inArray(e,g)===-1&&g.push(e)}):jQuery("tbody tr:"+d+"contains"+
363 i+"("+a+")",this.element).each(function(e,h){e=jQuery(h).removeClass("ui-ncbigrid-high");f&&e.removeClass("ui-ncbigrid-row-odd-high-IE6").removeClass("ui-ncbigrid-row-even-high-IE6");g.push(e)})}else{jQuery(".ui-ncbigrid-high",this.element).removeClass("ui-ncbigrid-high");f&&jQuery(".ui-ncbigrid-row-odd-high-IE6, .ui-ncbigrid-row-even-high-IE6",this.element).removeClass("ui-ncbigrid-row-odd-high-IE6").removeClass("ui-ncbigrid-row-even-high-IE6")}this.element.trigger("ncbigridhighlightremoved",[a,
364 b,c])},setCellData:function(a,b,c,d){jQuery("tbody"+(d!==undefined?":eq("+d+")":"")+" tr:nth-child("+a+") td:nth-child("+b+")",this.element).text(c);this.element.trigger("ncbigridcellchange",[a,b,this.getCellData(a,b)]);this._notifyGridUpdated();this._notifyGridContentChanged()},setRowData:function(a,b,c){jQuery("tbody"+(c!==undefined?":eq("+c+")":"")+" tr:nth-child("+a+") td",this.element).each(function(d,f){jQuery(f).text(b[d])});this.element.trigger("ncbigridrowchange",[a,this.getRowData(a,c)]);
365 this._notifyGridUpdated();this._notifyGridContentChanged()},_enableCollapseTbodyRows:function(a){if(this.options.collapseRowsEnabled){a||(a=jQuery(this.element).find("tbody tr:has(th)"));var b=this;jQuery(a).each(function(){jQuery(this).addClass("ui-ncbigrid-collapsable").find("th").eq(0).prepend('<span class="collapsableTbodyIcon ui-icon ui-icon-plus-minus-big-open"></span>').find("span").click(function(c){c.stopPropagation();b._collapseTbodyRows(this.parentNode.parentNode)}).end().end().not(".ignoreCollapse").click(function(){b._collapseTbodyRows(this.parentNode)})})}},
366 _collapseTbodyRows:function(a){jQuery(a).find("th span.collapsableTbodyIcon").toggleClass("ui-icon-plus-minus-big").toggleClass("ui-icon-plus-minus-big-open").end().siblings().toggleClass("collapsed")}});jQuery.extend(jQuery.expr[":"],{"contains-insensitive":function(a,b,c){return(a.textContent||a.innerText||"").toLowerCase().indexOf((c[3]||"").toLowerCase())>=0}});
367 jQuery.extend(jQuery.expr[":"],{"contains-regexp":function(a,b,c){a=jQuery.trim(a.textContent||a.innerText||"");c=c[3];b=c.match(/\/([gi]+)$/);b=b!==null?b[1]:"";c=c.replace(/\/[gi]?$/,"").replace(/^\//,"");return a.match(new RegExp(c,b))!==null}});jQuery.extend(jQuery.expr[":"],{"contains-functionTest":function(a,b,c){a=a.textContent||a.innerText||"";return jQuery.ui.jig._getFncFromStr(c[3])(a)}});
368 jQuery.extend(jQuery.expr[":"],{"not-contains":function(a,b,c){return(a.textContent||a.innerText||"").indexOf(c[3]||"")===-1}});jQuery.extend(jQuery.expr[":"],{"not-contains-insensitive":function(a,b,c){return(a.textContent||a.innerText||"").toLowerCase().indexOf((c[3]||"").toLowerCase())===-1}});
369 (function(){var a=jQuery.ui.ncbigrid.prototype.options;a.webservice=null;a.webserviceParams=null;a.isServersideLoad=false;a.isServersidePaging=false;a.isServersidePagingCached=false;a.isServersideSort=false;a.maxRowCount=null;a.columnNames=null;a.webserviceReturnsJSON=false;a.columns=null;a.record=null;a.groupField=null;a.localJSON=null;var b=jQuery.ui.ncbigrid.prototype._create,c=jQuery.ui.ncbigrid.prototype.sortDefaults,d=jQuery.ui.ncbigrid.prototype._killActiveSort,f=jQuery.ui.ncbigrid.prototype._sort,
370 g=jQuery.ui.ncbigrid.prototype._indexGrid,i=jQuery.ui.ncbigrid.prototype._waitForCache,e=jQuery.ui.ncbigrid.prototype.filterRows,h=jQuery.ui.ncbigrid.prototype.removeFilterRows,j=jQuery.ui.ncbigrid.prototype._updateRows,k=jQuery.ui.ncbigrid.prototype.getRowCount,l=jQuery.ui.ncbigrid.prototype.getMaxPage,n=jQuery.ui.ncbigrid.prototype._updateCount,s=jQuery.ui.ncbigrid.prototype._gotoPage,r=jQuery.ui.ncbigrid.prototype.checkAll,v=jQuery.ui.ncbigrid.prototype.uncheckAll;jQuery.widget("ui.ncbiservergrid",
371 jQuery.ui.ncbigrid,{_loadCreateCallback:false,_create:function(){this._checkForTemplating();if(this.options.isServersidePaging){this.options.isPageable=true;if(this.options.isServersideLoad&&!this.options.maxRowCount&&this.options.currentPage>1)this.options.maxRowCount=this.options.currentPage*this.options.pageSize}if(this.options.isServersideSort)this._isIndexed=this.options.isSortable=true;if(this.options.localJSON!==null){this._loadCreateCallback=true;this._processData(this.options.localJSON,"success",
372 {})}else if(this.options.isServersideLoad&&!this.options.isServersidePaging){this._loadCreateCallback=true;this._fetchData()}else b.apply(this,arguments)},_checkForTemplating:function(){if(this.options.columns){this.options.isServersideLoad=true;this._createHeaders()}},_createHeaders:function(){var o=jQuery("<thead></thead>"),q=jQuery("<tr></tr>"),m=this.options.columns;this._numColHead=m.length;for(var p=0;p<m.length;p++){var u=m[p],x=u.isSortable===false?"none":u.columnType||"str";jQuery("<th"+
373 (u.isHidden?" class='ui-ncbigrid-column-hidden'":"")+"></th>").html(u.header).data("columntype",x).appendTo(q)}o.append(q);this.element.append(o)},_processTemplating:function(o,q){function m(){for(var K=0;K<J&&M<G;K++){for(var N=jQuery(D[K]),B=["<tr>"],F="__DEFAULT__",H=0;H<w;H++){var z=x[H],O=z.dataIndex,T=z.isHidden?" class='ui-ncbigrid-column-hidden'":"";jQuery.isArray(O)||(O=[O]);for(var P=[],I=0;I<O.length;I++){var Q=O[I];if(y){var L=N.find(Q).text();L||(L=N.attr(Q));L||(L=N.find("["+Q+"]").attr("prop"));
374 L||(L=" ")}else if(C){L=Q.split(".");for(var U=N[0],W=0;W<L.length;W++){U=U[L[W]];if(typeof U==="undefined")break}L=U||""}P.push(L)}if(z.renderer)z=z.renderer.apply(p,P);else if(z.template){z=z.template;for(I=0;I<O.length;I++)z=z.replace(new RegExp("\\$\\{"+O[I].replace(/\./g,"\\.")+"\\}","g"),P[I])}else z=P.join("");B.push("<td"+T+">"+z+"</td>");if(E!==null&&E===Q)F=z}B.push("</tr>");if(!A[F]){A[F]=[];S++;R.push(F)}A[F].push(B.join(""));M++}N=R.sort();if(M>=G)if(S==1){B="";for(var V in A)B=A[V].join("");
375 p._wrapUpProcessing("success",B)}else{for(K=0;K<N.length;K++){V=N[K];B="<tbody><tr><th colspan='"+p.options.columns.length+"'>"+V+"</th></tr>";B+=A[V].join("")+"</tbody>";p.element.append(B)}p._wrapUpProcessing("multipleTBodies",null)}else window.setTimeout(function(){m()},0)}var p=this,u=this.options.record,x=this.options.columns,w=this._numColHead,y=q==="xml",C=q==="json";if(y)var D=o.getElementsByTagName(u);else if(C){q=u.split(/\./);D=o;for(o=0;o<q.length;o++)D=D[q[o]]}var A={},E=this.options.groupField,
376 R=[],M=0,G=D.length,J=jQuery.browser.msie?300:2E3,S=0;m()},getMaxPage:function(){var o=this.options.isServersidePaging?Math.ceil(this.getRowCount()/this.options.pageSize):l.apply(this,arguments);return o===0?1:o},getRowCount:function(){return this.options.isServersidePaging?this.options.maxRowCount||0:k.apply(this,arguments)},_updateRows:function(){if(this.options.isServersidePaging||this.options.isServersideSort)this._updateRowsServer();else return j.apply(this,arguments);if(this._wasSorted){this._wasSorted=
377 false;this.element.trigger("ncbigridcolumnsorted",[this.options.sortColumn+1,this.options.sortColumnDir])}},_updateRowsServer:function(){var o=null;if(this.options.isServersidePagingCached)o=this.isInCache();if(o)this._displayTheRows(o);else if(this._isInitialFetch&&!this.options.isServersideLoad){this.addToCache(this.element.find("tbody").html());this._isInitialFetch=false}else this._fetchData(this._isInitialFetch)},_isInitialFetch:true,_fetchData:function(o){var q=this;this.element.trigger("ncbigridshowloadingbar");
378 this._activeRequest&&this._activeRequest.readyState<4&&this._activeRequest.abort();var m=this._handlewebserviceParams();if(this.options.isServersidePaging){m.parameters.page=this.getCurrentPage();m.parameters.pageSize=this.options.pageSize}if(this.options.isServersideSort&&this.options.sortColumn!==-1){var p=this.options.columnNames;m.parameters.sortCol=p?p[this.options.sortColumn]:this.options.sortColumn+1;m.parameters.sortDir=this.options.sortColumnDir}m={url:m.url,data:m.parameters,success:function(u,
379 x,w){q._processData(u,x,w,o)},error:function(u,x,w){q._processError(u,x,w)}};if(this.options.webserviceReturnsJSON)m.dataType="json";this._activeRequest=jQuery.ajax(m)},_handlewebserviceParams:function(){var o=this.options.webservice,q=this.options.webserviceParams||this.options.webServiceParams,m={};if(q)if(typeof q==="string"){var p=q.charAt(0)!=="?"||o.indexof("?")===-1?"?":"";o=o+p+q}else for(var u in q)m[u]=q[u];if(q=this.options.webserviceFilterParams)for(u in q)m[u]=q[u];return{url:o,parameters:m}},
380 _activeRequest:null,_processData:function(o,q,m,p){var u=null;if(m.responseXML)this._processTemplating(m.responseXML,"xml");else if(typeof o==="object"&&!o.htmlRows)this._processTemplating(o,"json");else{if(this.options.webserviceReturnsJSON){u=o.totalRowCount;o=o.htmlRows}else{if(m=o.match(/<!--\s*(\d+)\s+(\d+)\s+(\d+)/)){parseInt(m[1],10);parseInt(m[2],10);u=parseInt(m[3],10)}o=o}this._wrapUpProcessing(q,o,p);if(u)this.options.maxRowCount=u;if(p&&this.options.isServersidePaging||u!==null&&u!==undefined&&
381 u!==this.getRowCount())this._setPageInit()}},_wrapUpProcessing:function(o,q,m){if(o==="success"){this._displayTheRows(q,m);this._checkAllState&&this.checkAll(true);this.addToCache(q)}if(this._loadCreateCallback){b.apply(this);if(!this.options.isServersideSort&&this.options.isSortable){g.apply(this,arguments);this._showHidePageToolbar()}}},_processError:function(o,q,m){if(typeof console!=="undefined"&&console.warn){console.group&&console.group("Failed Request");console.warn("The request failed to retrieve the rows");
382 if(console.info){console.info(o);console.info(q);console.info(m)}console.group&&console.groupEnd("Failed Request")}},_displayTheRows:function(o,q){this.element.trigger("ncbigridresetscroll");this.element.trigger("ncbigridhideloadingbar");var m=this.element.find("tbody");if(m.length===0)m=jQuery("<tbody></tbody>").appendTo(this.element);m.html(o);m=this.getHiddenShownColumns();o=m.hidden;m=m.shown;for(var p=0;p<o.length;p++)this.hideColumn(o[p]);for(p=0;p<m.length;p++)this.showColumn(m[p]);this._showHidePageToolbar();
383 this.element.trigger("rowsAdded");q||this._notifyGridUpdated()},_cachedRows:{},getCacheKey:function(){var o=this.getCurrentPage().toString(),q=this.options.pageSize.toString(),m=this.options.sortColumn.toString(),p=this.options.sortColumnDir.toString();o=o+"_"+q+"_"+m+"_"+p;m=this.options.webserviceParams;q="";if(typeof m==="string")q+="_"+m;else for(var u in m)q+="_"+m[u];if(u=this.options.webserviceFilterParams)for(var x in u)q+="_"+u[x];return o+q},addToCache:function(o,q){if(this.options.isServersidePagingCached)this._cachedRows[q||
384 this.getCacheKey()]=o},isInCache:function(o){return this._cachedRows[o||this.getCacheKey()]||null},_sort:function(){this._wasSorted=true;f.apply(this,arguments)},sortDefaults:function(){this.options.isServersideSort||c.apply(this,arguments)},_killActiveSort:function(){this.options.isServersideSort||d.apply(this,arguments)},_waitForCache:function(){this.options.isServersideSort?this._updateRows():i.apply(this,arguments)},_indexGrid:function(){},filterRows:function(o,q,m){if(this.options.isServersideLoad&&
385 !this.options.isServersidePaging)e.apply(this,arguments);else{this.options.webserviceFilterParams={};this.options.webserviceFilterParams.filterText=o||"";if(q!=null)this.options.webserviceFilterParams.filterCaseInsen=q;if(m!=null)this.options.webserviceFilterParams.filterCol=m;this.options.isServersidePaging?this.gotoPage(0):this._updateRows();this.element.trigger("ncbigridfilterapplied",[o,q,m,null,null]).trigger("ncbiservergridfilterapplied",[o,q,m,null,null])}},removeFilterRows:function(){if(this.options.isServersideLoad&&
386 !this.options.isServersidePaging)h.apply(this,arguments);else{this.options.webserviceFilterParams={};this.options.isServersidePaging?this.gotoPage(0):this._updateRows()}this.element.trigger("ncbigridfilterremoved",[null,null,null]).trigger("ncbiservergridfilterremoved",[null,null,null])},refresh:function(o,q){this._checkAllState=!!q;if(this.options.isServersidePagingCached)this._cachedRows={};if(this.options.isServersidePaging){q=this.options.currentPage;if(!o){q=0;this.options.currentPage=-1;this.element.find("tbody").children().find("input[type='checkbox']").prop("checked",
387 this._checkAllState)}this.gotoPage(q)}else this._updateRows();this.options.checkboxToolbarEnabled&&this._updateCount()},_cachedPageCheckHelper:function(o,q){if(q){q=o?"addClass":"removeClass";for(var m=this.getCacheKey()||"",p=m.replace(/^\d+/,""),u=this.getMaxPage(),x=1;x<=u;x++){var w=x+p,y=this.isInCache(w);if(w===m)y=this.element.find("tbody tr");if(y){y=jQuery(y);y.find(":checkbox").prop("checked",o).closest("tr")[q]("ui-ncbigrid-row-selected");this.addToCache(y,w)}}}},checkAll:function(o){this._cachedPageCheckHelper(true,
388 o);r.apply(this,arguments)},uncheckAll:function(o){this._cachedPageCheckHelper(false,o);v.apply(this,arguments)},_updateCount:function(){if(this.options.isServersidePagingCached){var o=0,q="filter";if(this._checkAllState){o=this.getRowCount();q="not"}for(var m=0,p=this.getCacheKey()||"",u=p.replace(/^\d+/,""),x=this.getMaxPage(),w=1;w<=x;w++){var y=w+u,C=this.isInCache(y);if(y===p)C=this.element.find("tbody tr");if(C){y=jQuery(C).find(":checkbox")[q](":checked").length||0;m+=y}}o=this._checkAllState?
389 o-m:m;this._chekboxBars.find("span.ui-ncbigrid-selected-text").html(o)}else n.apply(this,arguments)},_gotoPage:function(){var o=this.options.isServersidePagingCached;o&&this._prevCacheKey&&this.options.currentPage!==-1&&this.addToCache(this.element.find("tbody tr"),this._prevCacheKey);s.apply(this,arguments);if(o)this._prevCacheKey=this.getCacheKey()},_cbSerialize:function(o){var q=[];o.each(function(){q.push(this.name+"="+(this.checked?"on":"off"))});return q.join("&")},serializeCachedCheckboxes:function(o){var q=
390 null;if(this.options.isServersidePagingCached){q=[];for(var m=this.getCacheKey()||"",p=m.replace(/^\d+/,""),u=this.getMaxPage(),x=1;x<=u;x++){var w=x+p,y=this.isInCache(w);if(w===m)y=this.element.find("tbody tr");if(y)(w=o===undefined?this._cbSerialize(jQuery(y).find(":checkbox")):o?jQuery(y).find(":checkbox").serialize():this._cbSerialize(jQuery(y).find(":checkbox").not(":checked")))&&w.length>0&&q.push(w)}q=q.join("&")}return q},_setPageInit:function(){this.element.trigger("resetScroll");var o=
391 this._getCurrentPage(),q=this.getMaxPage();this._showHidePageToolbar();this._updateButtons(o,q);this._updatePagingText(o,q);this._updateGoto(o,q);this._updateItemRange(o,q);this._pageBars.find(".ui-ncbigrid-paged-pageControl").attr({"aria-valuemin":"1","aria-controls":this.element.attr("id"),"aria-valuemax":q,"aria-valuenow":o})}})})();
392 (function(a){a.widget("ui.ncbielastictextarea",{styles:{copy:["paddingTop","paddingRight","paddingBottom","paddingLeft","fontSize","lineHeight","fontFamily","width","fontWeight"]},_create:function(){function b(h,j){curratedHeight=Math.floor(parseInt(h,10))+3;d.height()!=curratedHeight&&d.css({height:curratedHeight+"px",overflow:j})}function c(h){var j=d.val().replace(/&/g,"&amp;").replace(/  /g,"&nbsp;").replace(/<|>/g,"&gt;").replace(/\n/g,"<br />"),k=f.html();if(j+"&nbsp;"!=k||h=="force"){f.html(j+
393 "&nbsp;");if(Math.abs(f.height()+g-d.height())>3){h=f.height()+g;if(h>=e)b(e,"auto");else h<=i?b(i,"hidden"):b(h,"hidden")}}}var d=this.element;if(d.attr("type")!="textarea"&&d.get(0).nodeName.toLowerCase()!="textarea")return false;this.elastic_uid=a.ui.jig._generateId("ncbielastictextarea");d.css("word-wrap","break-word");var f=a("<div />").css({position:"absolute",display:"none","word-wrap":"break-word"}).attr("id",this.elastic_uid),g=parseInt(d.css("line-height"),10)||parseInt(d.css("font-size"),
394 "10"),i=parseInt(d.css("height"),10)||g*3,e=parseInt(d.css("max-height"),10)||Number.MAX_VALUE;if(e<0)e=Number.MAX_VALUE;f.appendTo(d.parent());a(this.styles.copy).each(function(){f.css(this.toString(),d.css(this.toString()))});a(window).bind("resize."+this.elastic_uid,function(){f.css("width",d.width()+"px");c("force")});d.css({overflow:"hidden"});f.css("width",d.width()+"px");d.bind("keyup."+this.elastic_uid,function(){c()});d.bind("input."+this.elastic_uid+" paste."+this.elastic_uid,function(){setTimeout(c,
395 250)});c()},destroy:function(){this.element.unbind("."+this.elastic_uid);a("#"+this.elastic_uid).remove();this.element.css({"word-wrap":"",overflow:"",height:""});a(window).unbind("resize."+this.elastic_uid);a.Widget.prototype.destroy.apply(this,arguments)}});a.ui.ncbielastictextarea.prototype.options={};a.ui.ncbielastictextarea.prototype.version="1.2"})(jQuery);
396 (function(a){a.widget("ui.ncbilinkedselects",{_selectEls:[],_localMap:null,options:{firstPopulatedFromDs:true,localData:null,localDataCallback:null,initialSelected:null,selects:null,webservice:null,loadingSpinner:true,loadingText:"Loading...",loadingImage:jQuery.ui.jig._baseURL+"/img/loading.gif"},_create:function(){if(this.options.localData)this._localMap=eval(this.options.localData);else this._initResponseCache();this._selectEls=this.getSelects();this._prepareSelects();this._setEvents();this.options.firstPopulatedFromDs&&
397 this._populateFirstSelect();this.options.initialSelected&&this._selectInitialOptions()},_selectInitialOptions:function(){var b=this.options.initialSelected.split(","),c=this,d=function(){for(var f=a(this),g,i=0;i<c._selectEls.length;i++)if(f[0]===c._selectEls[i]){g=i;break}f.find(b[g]).attr("selected","selected");f.trigger("change");f[0]===c._selectEls[c._selectEls.length-1]&&a(document).unbind("ncbilinkedselectspopulated",d)};a(this._selectEls).bind("ncbilinkedselectspopulated",d)},_appendToSelect:function(b,
398 c){b.append(c);b.trigger("ncbilinkedselectspopulated")},_populateFirstSelect:function(){if(this.options.localData)for(var b=this._getFirstOptionsFromLocalDs(),c=this._isArrayOfStrings(b),d=0;d<b.length;d++){var f=b[d];if(c)this._appendToSelect(this.element,'<option value="'+f+'">'+f+"</option>");else for(var g in f)this._appendToSelect(this.element,'<option value="'+f[g]+'">'+g+"</option>")}else this._getAndAppendFromWebService(this.element,{})},_getFirstOptionsFromLocalDs:function(){var b=[];if(this.options.localDataCallback)b=
399 this.options.localDataCallback.apply(this,[this._localMap]);else for(var c=0;c<this._localMap.length;c++){var d=this._localMap[c];if(typeof d==="string")b.push(d);else a.isPlainObject(d)&&b.push(d)}return b},getSelects:function(){if(this.options.selects)var b=a(this.options.selects);else{b=this.element.closest("fieldset, form");b.length===0&&a.ui.jig._isConsole("warn")&&console.warn("jig warning: ncbilinkedselects. Your select elements must be within either a fieldset or a form element");b=b.find("select");
400 for(var c=false,d=[],f=0;f<b.length;f++){var g=b[f];if(g==this.element[0])c=true;c&&!a(g).hasClass("ui-ncbilinkedselects-ignore")&&d.push(g)}return a(d)}return this.element.add(b)},_prepareSelects:function(){this._selectEls.each(function(){a(this).addClass("ui-ncbilinkedselect-element")})},_setEvents:function(){var b=this;this._selectEls.each(function(){var c=a(this),d=this.name;b._isLastSelect(d)||c.bind("change",function(f){b._resetNextSelects(d);b._populateNext(f)});c.hasClass("jig-ncbiselect")&&
401 c.bind("ncbilinkedselectspopulate",function(){c.ncbiselect("update")})})},_resetNextSelects:function(b){for(var c=false,d=0;d<this._selectEls.length;d++){var f=a(this._selectEls[d]);if(f.attr("name")==b)c=true;else c&&f.children("option").each(function(){var g=a(this);g.hasClass("ui-ncbilinkedselects-perm")||g.remove()})}},_getSelectPath:function(b){for(var c=[],d=this.getSelects(),f=0;f<d.length;f++){var g=d[f];c.push(a(g).val());if(b.get(0)==g)break}return c},_getParamString:function(){var b=[];
402 this.getSelects().each(function(){a(this).find("option:selected").hasClass("ui-ncbilinkedselects-perm")||b.push(this)});return a(b).serialize()},_populateNext:function(b){b=a(b.target);var c=b.children("option:selected");if(!c.hasClass("ui-ncbilinkedselects-perm")){b.attr("name");b.val();var d=this._getNextSelect(b.attr("name"));if(this.options.webservice)this._getAndAppendFromWebService(d);else this.options.localData&&this._populateSelectFromLocalMap(b,c,d)}},_initResponseCache:function(){this._responseCache=
403 {}},_setCachedResponse:function(b){var c=this._getParamString();this._responseCache[JSON.stringify(c)]=b},_getCachedResponse:function(){var b=this._getParamString();b=JSON.stringify(b);return b in this._responseCache?this._responseCache[b]:null},_getAndAppendFromWebService:function(b){var c=this;if(!this.options.webservice){if(a.ui.jig._isConsole("warn")){console.warn("Unknown webservice for");console.warn(this.element)}return false}var d=this._getCachedResponse();if(d)this._appendToSelect(b,d);else{if(this.options.loadingSpinner){var f=
404 b.find("option");f.remove();var g=this._addLoadingIndicator(b)}a.get(this.options.webservice,this._getParamString(),function(i,e,h){response=h.responseText;if(c.options.loadingSpinner){c._removeLoadingIndicator(g);b.prepend(f)}c._setCachedResponse(response);c._appendToSelect(b,response)},"HTML")}},_addLoadingIndicator:function(b){var c=b.hasClass("jig-ncbiselect")?b.ncbiselect("getGeneratedElem"):b,d=c.offset(),f=c.outerWidth(),g=c.outerHeight();c=jQuery('<div class="ui-ncbilinkedselect-loading">').insertAfter(c).css({left:d.left,
405 top:d.top,width:f,height:g});c.append('<div class="ui-ncbilinkedselect-loading-overlay">');jQuery('<div class="ui-ncbilinkedselect-loading-text"><img src="'+this.options.loadingImage+'" />'+this.options.loadingText+"</div>").css("line-height",g+"px").appendTo(c);b.attr("size")>1&&c.css("text-align","center");return c},_removeLoadingIndicator:function(b){b.remove()},queryLocalService:function(b){function c(f){for(var g in f){var i=f[g];for(var e in i)if(i[e]==b[0]){if(b.length==1){f=f[parseInt(g)+
406 1];for(g=0;g<f.length;g++)a.isArray(f[g])||d.push(f[g]);return}b.shift()}jQuery.isArray(i)&&c(i,b)}}var d=[];c(this._localMap);return d},_getOptionId:function(b,c){return b+"-"+c.replace(/\s/,"-")},_populateSelectFromLocalMap:function(b,c,d){var f=this.options.localDataCallback;c=f?f.apply(this,[this._localMap,b,c,this._selectEls]):this.queryLocalService(this._getSelectPath(b));b=b.attr("id");f=this._isArrayOfStrings(c);for(var g=0;g<c.length;g++){var i=c[g];if(f){var e=b?' id ="'+this._getOptionId(b,
407 i)+'"':"";this._appendToSelect(d,'<option value="'+i+'"'+e+">"+i+"</option>")}else{var h,j;for(var k in i){h=k;j=i[k]}e=b?' id="'+this._getOptionId(b,j)+'"':"";this._appendToSelect(d,'<option value="'+j+'"'+e+">"+h+"</option>")}}},_isArrayOfStrings:function(b){return typeof b[0]==="string"},_isLastSelect:function(b){els=this._selectEls;return b===els[els.length-1].name?true:false},_isFirstSelect:function(b){els=this._selectEls;return b===els[0].name?true:false},_getNextSelect:function(b){for(var c=
408 0;c<this._selectEls.length;c++)if(this._selectEls[c].name==b)return a(this._selectEls[c+1])},change:function(b,c){a(this.getSelects()[b]).val(c).trigger("change")}})})(jQuery);
409 jQuery.widget("ui.ncbibasicmenu",{options:{defaultSelection:-1,allowMultipleSelections:false,orientation:"vertical",preventDefaultCheck:true,stopPropagationCheck:true,normalizeSubsToOneLevel:false,disableSelect:false},styles:{itemNoHilite:"ui-ncbimenu-item-no-hlt",itemSkip:"ui-ncbimenu-item-skip"},_init:function(){this._loadedOnce&&this.rescan();this._loadedOnce=true},_create:function(){this._setSelectorString();this._addClasses();this._formatList();this._addEvents();this._setUpDefaults();this._setTabIndex();
410 this._addAria()},rescan:function(){this._addClasses();this._setTabIndex();this._addAria();this._destroyFocusEvents();this._setUpFocusEvents()},destroy:function(){this._destroyTabIndex();this._destroyClasses();this._destroyEvents();this._destroyAria();this._destroyFormatList()},_setSelectorString:function(){var a=">";if(this.options.normalizeSubsToOneLevel){a="";this.element.addClass("oneLevel")}this._liSelector=a+"li:not(.ui-ncbimenu-item-skip)"},_addClasses:function(){this.isVert=this.options.orientation===
411 "vertical";var a="ui-ncbibasicmenu";this.isVert||(a+=" orientation_hort");this.element.addClass(a)},_destroyClasses:function(){this.element.removeClass("ui-ncbibasicmenu")},_setUpDefaults:function(){this.selectedOption=this.options.defaultSelection;if(this.selectedOption!==-1){var a=this.element.find(this._liSelector+">a");if(this.options.allowMultipleSelections)for(var b=0;b<this.selectedOption.length;b++)this._makeSelection(a.eq(this.selectedOption[b]),"load");else this._makeSelection(a.eq(this.selectedOption),
412 "load")}},_formatList:function(){},_destroyFormatList:function(){},_setTabIndex:function(){var a=this.element.find(this._liSelector+">a").attr("tabindex","-1"),b=this.element.find(this._liSelector+".selected>a");if(b.length>0)b=b.eq(0);else{var c=0;for(b=a.eq(0);b.is("."+this.styles.itemSkip+" a")&&c<a.length-1;){c+=1;b=a.eq(c)}}b.removeAttr("tabindex")},_destroyTabIndex:function(){this.element.find(this._liSelector+">a").removeAttr("tabindex")},_addEvents:function(){this._setUpKeyListener();this._setUpClickEvents();
413 this._setUpFocusEvents();this._setUpHoverEvents()},_destroyEvents:function(){this._destroyKeyListener();this._destroyClickEvents();this._destroyFocusEvents();this._destroyHoverEvents()},_setUpKeyListener:function(){if(!this._menuKeyListener){var a=this;this._menuKeyListener=function(b){if(a.element.is(":visible"))if(a._keyPressDetected(b.keyCode)){b.preventDefault();a.options.stopPropagationCheck&&b.stopPropagation()}};jQuery(document).keydown(this._menuKeyListener)}},_destroyKeyListener:function(){if(this._menuKeyListener){jQuery(window).unbind("keydown",
414 this._menuKeyListener);this._menuKeyListener=null}},_setUpClickEvents:function(){var a=this;this._ulClickEvent=function(b){var c=b.srcElement||b.target;if(c){a.options.disableSelect||a._makeSelection(jQuery(c),"click");a.options.stopPropagationCheck&&b.stopPropagation();a.options.preventDefaultCheck&&jQuery(c).siblings("ul").length===1&&b.preventDefault()}};this.element.on("click.ncbibasicmenu",this._ulClickEvent)},_destroyClickEvents:function(){this.element.off("click",this._ulClickEvent)},_setUpFocusEvents:function(){var a=
415 this;this._focusFnc=function(){a._menuFocused(this)};this._blurFnc=function(){a._menuBlured(this)};this.element.find(this._liSelector+">a").on("blur",this._blurFnc).on("focus",this._focusFnc)},_destroyFocusEvents:function(){this.element.find(this._liSelector+">a").off("blur",this._blurFnc).off("focus",this._focusFnc)},focus:function(){this._menuFocused(null)},_menuFocused:function(a){this._lastAnchor=a;this._isFocused=true},_menuBlured:function(a){if(this._lastAnchor==a)this._isFocused=false},removeFocus:function(){this._menuBlured()},
416 _setUpHoverEvents:function(){var a=this;this._mouseEnterFnc=function(b){b=jQuery(b.target).closest("li");!b.hasClass(a.styles.itemNoHilite)&&!b.hasClass(a.styles.itemSkip)&&b.addClass("hover")};this.mouseLeaveFnc=function(){jQuery(this).removeClass("hover")};this.element.on("mouseenter","li",this._mouseEnterFnc).on("mouseleave","li",this.mouseLeaveFnc)},_destroyHoverEvents:function(){this.element.off("mouseenter",this._mouseEnterFnc).off("mouseleave",this.mouseLeaveFnc);this.mouseLeaveFnc=this._mouseEnterFnc=
417 null},_makeSelection:function(a,b){var c=a.parent("li");if(c.length===1){var d=c.hasClass("selected");this.options.allowMultipleSelections||this._removeAllSelections();if(!c.hasClass(this.styles.itemSkip)){c.hasClass(this.styles.itemNoHilite)||c[d?"removeClass":"addClass"]("selected");var f=d?"unselected":"selected";b!=="menunav"&&this._trigger(f,"x",[a,c,b]);if(b==="click"||b==="load")this.selectedOption=this.element.find(this._liSelector+".selected").index();else d||c.find(">a").focus()}}this._setTabIndex()},
418 _keys:{up:38,down:40,left:37,right:39,enter:13,escape:27,tab:9},_keyPressDetected:function(a){var b=this._keys,c=false;if(this._isFocused&&this.element.has(this._liSelector+">a:focus"))switch(a){case b.up:this._upDownPressed(-1);c=true;break;case b.down:this._upDownPressed(1);c=true;break;case b.left:this._leftRightPressed(-1);c=true;break;case b.right:this._leftRightPressed(1);c=true;break;case b.enter:this._enterSelected();c=false;break;case b.escape:this._escapeTyped();c=false;break;case b.tab:this._trigger("tab");
419 default:c=false}return c},_upDownPressed:function(a){this.isVert?this._moveSelection(a):this._trigger(a===1?"actiondown":"actionup","x",this.focusedElement())},_leftRightPressed:function(a){this.isVert?this._trigger(a===1?"actionright":"actionleft","x",this.focusedElement()):this._moveSelection(a)},focusedElement:function(){return this.selectedOption!==-1?this.element.find(this._liSelector).eq(this.selectedOption):this.element.find(this._liSelector+":has(>a:focus)")},moveSelection:function(a){this._moveSelection(a)},
420 _getNextIndex:function(a,b,c){a=a+b;if(a<0)a=c-1;else if(a>c-1)a=0;return a},_moveSelection:function(a){for(var b=this.element.find(this._liSelector+">a"),c=this._getNextIndex(this.selectedOption,a,b.length);b.eq(c).closest("li").hasClass(this.styles.itemSkip);)c=this._getNextIndex(c,a,b.length);this.selectedOption=c;this._makeSelection(b.eq(c),"keyboard")},removeAllSelections:function(){this.selectedOption=-1;this._removeAllSelections();this._setTabIndex()},_removeAllSelections:function(){this.element.find(this._liSelector).removeClass("selected")},
421 _enterSelected:function(){this._trigger("enter")},_escapeTyped:function(){this._trigger("escape","x",this.focusedElement())},_addAria:function(){var a=this.element.parents('[role="menubar"]'),b=this.element.find(this._liSelector),c=b.find(">a");this.element.attr("role",a.length===0?"menubar":"menu");b.attr("role","presentation");c.attr("role","menuitem")},_destroyAria:function(){var a=this.element.find(this._liSelector),b=a.find(">a");this.element.removeAttr("role");a.removeAttr("role");b.removeAttr("role")},
422 selectFirstItem:function(){this.selectedOption=0;this._moveSelection(0)}});
423 jQuery.widget("ui.ncbimenu",{options:{isSubMenuLimited:false,delayTimeout:500,useHoverEvents:true},_create:function(){this._addClasses();this._addAria();this._createMenus();this._addListeners();this._addEvents();this._addAjaxEvents()},rescan:function(){this._destroyListeners();this._destroyEvents();this._addAria();this._createMenus();this._addListeners();this._addEvents()},destroy:function(){this._destroyEvents();this._destroyClasses();this._destroyAria();this._destroyListeners();this._destroyMenus()},
424 _addClasses:function(){this.element.addClass("ui-ncbimenu")},_destroyClasses:function(){this.element.removeClass("ui-ncbimenu")},_addAria:function(){this.element.attr("role","menubar").find("li").filter(":has(ul)").find("a").attr("aria-haspopup","true").end().find("ul").attr("aria-hidden","true")},_destroyAria:function(){this.element.removeAttr("role").find("li").removeAttr("role").filter(":has(ul)").find("a").removeAttr("aria-haspopup").removeAttr("role").end().find("ul").removeAttr("aria-hidden").removeAttr("role")},
425 _createMenus:function(){this.element.ncbibasicmenu({orientation:"horizontal"});var a=this.element.find(">li:has(>ul)");a.find(">a").addClass("expandDown");a.find(">ul").ncbibasicmenu();if(!this.options.isSubMenuLimited){a.find(">ul ul").ncbibasicmenu();a.find(">ul ul").parent().find(">a").addClass("expandRight")}},_destroyMenus:function(){this.element.removeClass("jig-ncbimenu cf ui-ncbibasicmenu orientation_hort").find("ul").andSelf().show().ncbibasicmenu("destroy")},_addEvents:function(){var a=
426 this;this._windowClickFnc=function(c){c=c.target||c.srcElement;a.element[0]===c||a.element.find(c).length===1||a.closeSub(a.element.find("ul"))};jQuery(window).on("click",this._windowClickFnc);this._unselectEverythingFnc=function(){a._unselectEverything()};this.element.find("li").not(":has(ul)").find("a").on("click",this._unselectEverythingFnc);this._blurFnc=function(){a._checkFocus()};this.element.on("blur","a",this._blurFnc);if(this.options.useHoverEvents){var b={timeout:this.options.delayTimeout,
427 over:function(){if(a._isActive){var c=jQuery(this),d=c.parent();if(d.has("ul").length===0){d=d.siblings("li.selected").removeClass("selected");a.closeSub(d);c.focus()}else d.hasClass("selected")||c.focus().click()}},out:function(){}};this.element.find(">li:not(:has(ul))>a,li:has(ul)>a").hoverIntent(b)}},_destroyEvents:function(){jQuery(window).off("click",this._windowClickFnc);this._windowClickFnc=null;this.element.off("blur","a",this._blurFnc);this._blurFnc=null;this.element.find(">li:not(:has(ul))>a,li:has(ul)>a").unbind("mouseover mouseoff");
428 this.element.find("li").not(":has(ul)").find("a").off("click",this._unselectEverythingFnc)},_addAjaxEvents:function(){if(this.element.find(">li:has(a.expandDown)").not(":has(ul)").length>0){var a=this;this._ajaxEnterFnc=function(){a._loadAjaxContent()};this.element.on("mouseenter",this._ajaxEnterFnc)}},_loadAjaxContent:function(){var a=this;this.element.off("mouseenter",this._ajaxEnterFnc);this._ajaxEnterFnc=null;var b=this.element.find("a.expandDown"),c=b.eq(0).prop("href").split("#");jQuery("<div/>").load(c[0],
429 function(){a._handleAjaxLoadCallback(this,b)})},_handleAjaxLoadCallback:function(a,b){var c=jQuery(a);b.each(function(){var d=jQuery(this),f=d.prop("href").split("#")[1];f=c.find("#"+f);if(f[0].tagName.toLowerCase()==="li")f=f.find(">ul");d.parent().append(f)});this._createMenus()},_checkFocus:function(){function a(){b.element.find("a:focus").length===0&&b._unselectEverything()}var b=this;window.setTimeout(a,10)},_addListeners:function(){var a=this;this.element.find(">ul").andSelf().on("ncbibasicmenuunselected",
430 function(b,c,d,f){f==="click"&&a.closeSub(d)}).on("ncbibasicmenuselected",function(b,c,d,f){if(f==="click")a.openSub(d);else{b=d.siblings().find("ul:visible");if(b.length>0){b.each(function(){a.closeSub(jQuery(this))});d.parent("ul").hasClass("ui-ncbimenu")&&a.openSub(d)}}}).on("ncbibasicmenuactiondown ncbibasicmenuactionright",function(b,c){c=jQuery(c);var d=c.find(">ul");if(c.hasClass("selected"))d.length===1&&d.not(":visible")&&a.openSub(c);else c.find(">a").click();d.length===1&&window.setTimeout(function(){d.ncbibasicmenu("selectFirstItem")},
431 10)}).on("ncbibasicmenuactionup ncbibasicmenuactionleft ncbibasicmenuescape",function(b,c){c=jQuery(c);b=c.find(">ul");if(b.length>0&&b.is(":visible"))a.closeSub(jQuery(c));else{c=c.parent("ul").parent("li");c.find(">a").focus();a.closeSub(c)}})},_destroyListeners:function(){this.element.find("ul").andSelf().off("ncbibasicmenuunselected").off("ncbibasicmenuselected")},openSub:function(a){var b=a.find(">ul");if(b.length===1){this._isActive=true;var c=a.parent().find("li:has(ul:visible)");c.length>
432 0&&this.closeSub(c);if(a.parent().hasClass("orientation_hort")){c="left bottom";var d="fit flip"}else{c="right center";d="flip fit"}b.show().position({of:a,my:"left top",at:c,collision:d}).attr("aria-hidden","false")}},closeSub:function(a){(a.is("li")?a.find("ul"):a).find("ul").andSelf().not(".ui-ncbimenu").hide().attr("aria-hidden","true").end().ncbibasicmenu("removeAllSelections").find("li.selected").removeClass("selected")},_unselectEverything:function(){this.closeSub(this.element.find("ul:visible").andSelf());
433 this._isActive=false}});(function(){jQuery.widget("ui.ncbilocalnav",jQuery.ui.ncbimenu,{_create:function(){this.options.isSubMenuLimited=true;jQuery.ui.ncbimenu.prototype._create.apply(this,arguments)},_addClasses:function(){this.element.addClass("ui-ncbilocalnav");jQuery.ui.ncbimenu.prototype._addClasses.apply(this,arguments)},_destroyClasses:function(){this.element.removeClass("ui-ncbilocalnav");jQuery.ui.ncbimenu.prototype._destroyClasses.apply(this,arguments)}})})();
434 jQuery.widget("ui.ncbipopper",{destTextCallbackCalledCount:0,options:{openMethod:"",openEvent:"mouseover",openAnimation:"slideDown",openAnimationTime:290,closeMethod:"",closeEvent:"mouseout",closeAnimation:"slideUp",closeAnimationTime:150,isEscapeKeyClose:true,isSourceElementCloseClick:false,isTriggerElementCloseClick:true,isTargetElementCloseClick:false,isDestElementCloseClick:false,isDocumentCloseClick:true,addCloseButton:false,adjustFit:"autoAdjust",delayTimeout:300,sourcePosition:"",destPosition:"top left",
435 sourceSelector:"",destSelector:"",targetPosition:"",triggerPosition:"bottom right",sourceText:null,destText:null,multipleHandlesSelector:"",openAtTarget:false,hasArrow:false,arrowDirection:"left",groupName:null,width:null,height:null,cssClass:null,excludeBasicCssStyles:false,wrapElement:false,loadingText:"loading...",showLoadingMessage:true,isDestTextCacheable:true,resizable:false,openAtMousePosition:false},_create:function(){this._setUpDestElem();this._addEventHandlers();this._addEscapeListener();
436 this._addDocumentClickListener();this._addResizeListener();this._addCloseButton();this._addSharingDetails();this._addPopperHover();this.addTriggerAria()},updateTriggers:function(){this._addEventHandlers();this._addDocumentClickListener();this.addTriggerAria()},destroy:function(){jQuery.Widget.prototype.destroy.apply(this,arguments);var a=this.isPopperShared();this._destroyDestAria();this._destroyTriggerAria();this._removeSharingDetails();this._destroyCloseButton(a);this._destroyResizeListener();this._destroyDocumentClickListener();
437 this._destroyEscapeListener();this._removeEventHandlers();this._destroyDestElem(a)},getDestElement:function(a){var b=this.destElem;if(!this.origDestElem)this.origDestElem=b;if(b){if(a&&this._isWaitingToBeAddedToDom){a=jQuery("div.grid");a=a.length===1?a:jQuery(document.body);b.appendTo(a);this._isWaitingToBeAddedToDom=true;this._getActualText(b)}}else{b=this.options.destSelector||this.options.sourceSelector||this.element.prop("hash");a=this.options.destText||this.options.sourceText;if(b){b=jQuery(b);
438 if(b.length===0)b=this._createTextHolder()}else if(a)b=this._createTextHolder();else throw"The popper can not find the popper element or text to display";if(this.options.wrapElement){if(!b.parent().hasClass("ui-ncbipopper-wrapper")){b.wrap('<div style="display:none"></div>');b.show()}if(!this.origDestElem)this.origDestElem=b;b=b.parent()}this.destElem=b;this._addDestAria()}if(!this.origDestElem)this.origDestElem=this.destElem;return b},_createTextHolder:function(){var a=jQuery('<div><div class="ui-ncbipopper-content"></div></div>');
439 this._isWaitingToBeAddedToDom=true;return a},_getActualText:function(a){if(!this.isFunctionResultCached){var b=this.options.destText||this.options.sourceText,c=this._getFunction(b);if(typeof c==="function")b=this._getText(c);a.css("display","none").attr("generated","true").find(".ui-ncbipopper-content").html(b)}},_getFunction:function(a){var b=null;if(jQuery.ui.jig&&jQuery.ui.jig._getFncFromStr)b=jQuery.ui.jig._getFncFromStr(a);else if(typeof a==="function")b=a;return b},getDestTextCallbackCalledCount:function(){return this.destTextCallbackCalledCount},
440 _getText:function(a){if(!(this.options.isDestTextCacheable&&this.getTextCalled||this.callbackInProgress)){this.getTextCalled=true;a||(a=this._getFunction(this.options.destText||this.options.sourceText));var b=this;this.callbackInProgress=true;a=a.call(this.element[0],function(c){b._setHTML(c);b.destTextCallbackCalledCount++;b.callbackInProgress=false})||this.options.loadingText;if(a!==this.options.loadingText)this.isFunctionResultCached=this.options.isDestTextCacheable;return a}},reloadContent:function(){var a=
441 this._getText(),b=this.getDestElement().find(".ui-ncbipopper-content");b&&b.html(a)},_setHTML:function(a){var b=this.getDestElement().find(".ui-ncbipopper-content");if(b){b.html(a);this.isFunctionResultCached=this.options.isDestTextCacheable;!this.options.showLoadingMessage&&!this.isPopperDisplayed&&this._openAnimation()}},_setUpDestElem:function(){var a=this.getDestElement().addClass("ui-ncbipopper-wrapper");this.options.excludeBasicCssStyles||a.addClass("ui-ncbipopper-basic");this.options.resizable&&
442 a.resizable();var b=this.options.cssClass;b&&a.addClass(b);this.options.width!==null&&a.width(this.options.width);this.options.height!==null&&a.height(this.options.height);this._resetElementPosition(a);a.removeClass("offscreen_noflow").hide();a.data("isOpen",false)},_setArrowDirection:function(){if(this.options.hasArrow){var a=this.options.arrowDirection;this._arrow&&this._arrow.removeClass("ui-ncbipopper-arrow-top ui-ncbipopper-arrow-bottom  ui-ncbipopper-arrow-left  ui-ncbipopper-arrow-right").addClass("ui-ncbipopper-arrow-"+
443 a)}},_setUpArrow:function(a,b,c){if(this.options.hasArrow){var d=this.options.arrowDirection;if(this._arrow)this._arrow.removeClass("ui-ncbipopper-arrow-top ui-ncbipopper-arrow-bottom  ui-ncbipopper-arrow-left  ui-ncbipopper-arrow-right").addClass("ui-ncbipopper-arrow-"+d);else this._arrow=jQuery('<div class="ui-ncbipopper-arrow-image ui-ncbipopper-arrow-'+d+'">&nbsp;</div>').appendTo(document.body);a=this._getPositionSettings(a,"arrow",c);this._arrow.show().position({my:a.dest,of:this._activeTrigger||
444 a.triggerElement||this.element,at:a.trigger,offset:a.offset,collision:"none"});if(b||this._arrowOverlapsPopper())this._arrow.hide()}},_destroyDestElem:function(a){a||this.getDestElement().removeClass("ui-ncbipopper-wrapper ui-ncbipopper-basic ui-ncbipopper-wrapper-relative-parent").attr("style","").show();this.options.wrapElement&&this.origDestElem.unwrap();this.destElem=null},_addEventHandlers:function(){var a=this,b=this.element,c=this.options.multipleHandlesSelector;if(c&&c.length>0)b=b.add(c);
445 var d=this.options.openMethod||this.options.openEvent,f=this.options.closeMethod||this.options.closeEvent;if(d===f&&f==="click"){this._openFunction=function(g){a._toggle(g,g.currentTarget);g.preventDefault()};b.on("click",this._openFunction)}else{c={timeout:this.options.delayTimeout};if(d==="mouseover")c.over=function(g){a._isOverTrigger=true;a.open(g,this)};else{c.over=function(){a._isOverTrigger=true};this._openFunction=function(g){if(d==="click")if(a.option.isTriggerElementCloseClick){a._toggle(g,
446 this);g.preventDefault()}else{a.isOpen(this)||g.preventDefault();a.open(g,this)}else a.open(g,this)};b.on(d,this._openFunction)}if(f==="mouseout")c.out=function(){a._isOverTrigger=false;a.isOpen(this)&&!a._isOverPopper&&a.close()};else{c.out=function(){};this._closeFunction=function(g){a.close();f==="click"&&g.preventDefault()};b.on(f,this._closeFunction)}if(d==="mouseover"||f==="mouseout")b.hoverIntent(c);if(this.options.isTriggerElementCloseClick&&f!=="click"&&d!=="click"){this._closeFunction2=
447 function(g){a.isOpen(b)&&a.close();g.preventDefault()};b.on("click",this._closeFunction2)}}if(this.options.isDestElementCloseClick){this._closeFunctionPopper=function(g){a.isOpen(b)&&a.close();g.preventDefault()};this.getDestElement().on("click",this._closeFunctionPopper)}},_removeEventHandlers:function(){var a=this.element,b=this.getDestElement(),c=this.options.multipleHandlesSelector;if(c&&c.length>0)a=a.add(c);a.off("mouseover mouseout");if(this._openFunction){a.off(this.options.openMethod||this.options.openEvent,
448 this._openFunction);this._openFunction=null}if(this._closeFunction){a.off(this.options.closeMethod||this.options.closeEvent,this._closeFunction);this._closeFunction=null}if(this._closeFunction2){a.off("click",this._closeFunction2);this._closeFunction2=null}if(this._closeFunctionPopper){b.off("click",this._closeFunctionPopper);this._closeFunctionPopper=null}},_toggle:function(a,b){this.isOpen(b)?this.close():this.open(a,b);a&&a.preventDefault&&a.preventDefault()},_arrowOverlapsPopper:function(){var a=
449 this.getDestElement(),b=Math.floor(a.position().top),c=Math.floor(a.position().left),d=Math.floor(c+a.outerWidth());a=Math.floor(b+a.height());var f=this._arrow,g=Math.floor(f.position().top),i=Math.floor(f.position().left);Math.floor(i+f.width());var e=Math.floor(g+f.height());c=i>c&&i<d||i+f.css("width")>c&&i+f.css("width")<d;b=g>b&&g<a||g+f.css("height")>b&&e+f.css("height")<a;return c&&b?true:false},_openAnimation:function(a){function b(){var l=d.outerHeight(),n=jQuery(window).height();l>n&&d.css({"max-height":n-
450 45+"px",overflow:"auto"});jQuery(window).trigger("resize")}var c=this,d=this.getDestElement().data("isOpening",this.element).stop(true,true),f=this._arrow,g=this.options.openAnimation,i=function(){c._trigger("opencomplete");c.getDestElement().data("isOpening",null);jQuery.browser.msie&&parseInt(jQuery.browser.version,10)<=7&&c._positionPopper(a,false,true);b()},e=function(l){f.fadeTo(0,0);window.setTimeout(function(){f.stop(true,true).show();c._arrowOverlapsPopper()||f.css("opacity",1)},l)};if(g===
451 "none"||this.isOpen()){d.show();f&&e(0);i()}else{var h=this.options.openAnimationTime;if(f){var j=0;if(f==="top")j=0;else if(f==="bottom")j=h;else{j=parseInt(f.css("top"),10)-parseInt(d.css("top"),10);var k=d.height()||j;j=j/k*h;if(j>h)j=h}e(j)}d[g](h,i)}},open:function(a,b){if(!b)b=this.element;if(this.options.openAtTarget){if(this._activeTrigger!==b){this.getDestElement().hide();this.getDestElement().data("isOpen",false)}this._activeTrigger=b}else this._activeTrigger=this.element;b=this.getDestElement();
452 var c=b.data("isOpening");if(c&&c[0]!==this.element[0])(b.data("closeFnc")||function(){})(true);this._handleSharedPoppersOpen();this._handleGroupsOpen();b.data("isOpening",this.element);this._setUpArrow(a,true,true);jQuery.browser.msie&&this._positionPopper(a,true,true);this._setParentsZIndex(11);this._positionPopper(a,true,true);this._trigger("open");this.options.destText&&!this.options.showLoadingMessage&&!this.isFunctionResultCached||this._openAnimation(a);this._setAriaState(true);this.getDestElement().data("isOpen",
453 true)},_handleGroupsOpen:function(){var a=this.options.groupName;if(a){this.closeGroup(a);jQuery.ui.ncbipopper.openGroups[a]=this.element}},_closeAnimation:function(a){var b=this,c=function(){b._setParentsZIndex(1);b._trigger("closecomplete")},d=this.getDestElement().data("isOpening");if(d&&this.element[0]!=d[0])c();else{d=this.getDestElement().stop(true,true);var f=this.options.closeAnimation;if(f==="none"||a){d.hide();this._resetElementPosition(d);c()}else{var g=d;d[f](this.options.closeAnimationTime,
454 function(){b._resetElementPosition(g);c()})}}a=this.getDestElement().data("popperTriggers");for(f=0;f<a.length;f++){d=jQuery.ui.jig.getElementWidgets(a[f],"ncbipopper")[0];var i=d._arrow;if(i){i.stop(true,true).hide();d._resetElementPosition(i)}}},close:function(a){if(this.isOpen(this._activeTrigger)){this._handleGroupsClose(a);this._trigger("close");this._activeTrigger=null;this._closeAnimation(a);this._setAriaState(false);this.getDestElement().data("isOpen",false)}},closeGroup:function(a){if(a=
455 a||this.options.groupName)(a=jQuery.ui.ncbipopper.openGroups[a])&&jQuery.ui.jig.getElementWidgets(a,"ncbipopper")[0].close(true)},_handleGroupsClose:function(a){var b=this.options.groupName;if(!a&&b)jQuery.ui.ncbipopper.openGroups[b]=null},_determineAutoPosition:function(a){var b=jQuery(this._activeTrigger||this.element),c=b.offset(),d=this.getDestElement(true),f=jQuery(window);if(a){a=f.width();d=d.outerWidth();b=b.width();f=f.scrollLeft();if(d+b+c.left<a+f){c="right";b=f="left"}else{c="left";b=
456 f="right"}}else{a=f.height();d=d.outerHeight();b=b.height();f=f.scrollTop();if(d+b+c.top<a+f){c="bottom";b=f="top"}else{c="top";b=f="bottom"}}return{posT:c,posP:f,arrow:b}},_getPositionSettings:function(a,b,c){var d=this.options.sourcePosition||this.options.destPosition,f=this.options.targetPosition||this.options.triggerPosition;d=d.split(/\s/);f=f.split(/\s/);if(d[0]==="middle")d[0]="center";if(d[1]==="middle")d[1]="center";if(f[0]==="middle")f[0]="center";if(f[1]==="middle")f[1]="center";this.options.sourcePosition=
457 null;this.options.destPosition=d.join(" ");this.options.targetPosition=null;this.options.triggerPosition=f.join(" ");var g;if(d[0]==="auto"){g=this._determineAutoPosition(false);d[0]=g.posP;f[0]=g.posT;this.options.arrowDirection=g.arrow;this._setArrowDirection(g.arrow)}if(d[1]==="auto"){g=this._determineAutoPosition(true);d[1]=g.posP;f[1]=g.posT;this.options.arrowDirection=g.arrow;this._setArrowDirection(g.arrow)}g=d[1]+" "+d[0];var i=f[1]+" "+f[0],e="0px 0px";if(this.options.hasArrow)e=b==="popper"?
458 this._getPopperOffsets(d[0],d[1]):this._getArrowOffsets(d[0],d[1]);if(this.options.openAtMousePosition&&c){e.xOffset=a.pageX-jQuery(a.target).offset().left+(e.xOffset-0)+1;e.yOffset=a.pageY-jQuery(a.target).offset().top+(e.yOffset-0)}if(this._isArea===undefined)this._isArea=((this._activeTrigger?this._activeTrigger[0]:false)||this.element[0]).nodeName.toUpperCase()==="AREA";if(this._isArea){a=this._areaElementAdjustment(e,f);triggerElement=a.positionElement;e=a.offset;i="left top"}else triggerElement=
459 null;if(this.options.openAtMousePosition&&c)i="left top";return{dest:g,trigger:i,offset:e.xOffset+"px "+e.yOffset+"px",triggerElement:triggerElement}},_getArrowOffsets:function(a,b){var c="0",d="0";switch(this.options.arrowDirection){case "left":case "right":switch(a){case "top":d="-13";break;case "center":d="0";break;case "bottom":d="13";break;default:d="0";break}break;case "top":case "bottom":switch(b){case "left":c="-13";break;case "center":c="0";break;case "right":c="13";break;default:c="0";break}break;
460 default:throw"Valid arrow directions are top, bottom, left, right";}return{xOffset:c,yOffset:d}},_getPopperOffsets:function(a,b){var c="0",d="0";c=this.options.arrowDirection;switch(c){case "left":case "right":c=c==="left"?"7":"-7";switch(a){case "top":d="-13";break;case "center":d="0";break;case "bottom":d="13";break;default:d="0";break}break;case "top":case "bottom":d=c==="top"?"7":"-7";switch(b){case "left":c="-13";break;case "center":c="0";break;case "right":c="13";break;default:c="0";break}break;
461 default:throw"Valid arrow directions are top, bottom, left, right";}return{xOffset:c,yOffset:d}},_areaElementAdjustment:function(a,b){a=a.split(" ");var c=parseInt(a[0],10);a=parseInt(a[1],10);var d=jQuery(this._activeTrigger||this.element).parent(),f=this._activeTrigger||this.element[0];d=jQuery("img[usemap='#"+(d[0].name||d[0].id)+"']");var g=f.shape||"rect";f=(f.coords||"").split(/\s?,\s?/g);d=d;var i=0,e=0;if(g==="circle"){if(b[0]=="top")e=parseFloat(f[1])-parseFloat(f[2]);else if(b[0]=="bottom")e=
462 f[3]+parseFloat(f[2]);else if(b[0]=="center")e=parseFloat(f[1]);if(b[1]==="left")i=f[0]-parseFloat(f[2]);else if(b[1]==="right")i=f[2]+parseFloat(f[2]);else if(b[1]==="center")i=parseFloat(f[0])}else{if(b[0]=="top")e=parseFloat(f[1]);else if(b[0]=="bottom")e=parseFloat(f[3]);else if(b[0]=="center")e=(parseFloat(f[1])+parseFloat(f[3]))/2;if(b[1]==="left")i=parseFloat(f[0]);else if(b[1]==="right")i=parseFloat(f[2]);else if(b[1]==="center")i=(parseFloat(f[0])+parseFloat(f[2]))/2}i+=c;e+=a;return{positionElement:d,
463 offset:i+"px "+e+"px"}},_getCollisionSetting:function(){var a=this.options.adjustFit;return a=a==="autoAdjust"||a==="slide"?"fit":"none"},_resetElementPosition:function(a){a.css("top","-100px").css("left","-100px")},_positionPopper:function(a,b,c){a=this._getPositionSettings(a,"popper",c);c=this._getCollisionSetting();var d=a.triggerElement||this.options.openAtTarget&&this._activeTrigger||this.element;a=this.getDestElement(true).stop().show().position({my:a.dest,of:d,at:a.trigger,offset:a.offset,
464 collision:c}).data("attached-to",d);b&&a.hide()},_addEscapeListener:function(){if(this.options.isEscapeKeyClose){this._registerGlobalEscapeListener();var a=this;this._ncbipopperescapepressedFunction=function(){a.close()};jQuery(document).bind("ncbipopperescapepressed",this._ncbipopperescapepressedFunction)}},_destroyEscapeListener:function(){if(this._ncbipopperescapepressedFunction){jQuery(document).unbind("ncbipopperescapepressed",this._ncbipopperescapepressedFunction);this._ncbipopperescapepressedFunction=
465 null}},_registerGlobalEscapeListener:function(){if(!jQuery.ui.ncbipopper.globalEvents.isGlobalEscapeRegistered){jQuery.ui.ncbipopper.globalEvents.isGlobalEscapeRegistered=true;var a=document,b="keypress";if(!jQuery.browser.msie&&!jQuery.browser.mozilla){a=window;b="keydown"}jQuery(a)[b](function(c){c.keyCode===27&&jQuery(document).trigger("ncbipopperescapepressed")})}},_addDocumentClickListener:function(){if(this.options.isDocumentCloseClick){this._registerGlobalClickListener();var a=this;this._ncbipopperdocumentclickFunction=
466 function(b,c){a._checkDocumentClick(b,c)};jQuery(document).bind("ncbipopperdocumentclick",this._ncbipopperdocumentclickFunction)}},_destroyDocumentClickListener:function(){this._ncbipopperdocumentclickFunction&&jQuery(document).unbind("ncbipopperdocumentclick",this._ncbipopperdocumentclickFunction)},_registerGlobalClickListener:function(){if(!jQuery.ui.ncbipopper.globalEvents.isGlobalClickRegistered){jQuery.ui.ncbipopper.globalEvents.isGlobalClickRegistered=true;jQuery(document).click(function(a){jQuery(document).trigger("ncbipopperdocumentclick",
467 [a.srcElement||a.target])})}},_checkDocumentClick:function(a,b){if(b&&this.isOpen()){b=jQuery(b);if(!(this._isSameElementOrChild(jQuery(this.element),b)||this._isSameElementOrChild(this.getDestElement(),b)))if(!(jQuery.ui.jig.getElementWidgets(jQuery(b),"ncbipopper")[0]&&this.getDestElement()[0]==jQuery.ui.jig.getElementWidgets(jQuery(b),"ncbipopper")[0].getDestElement()[0])){if(a=this.options.multipleHandlesSelector){var c=false,d=this;jQuery(a).each(function(){if(d._isSameElementOrChild(jQuery(this),
468 b))c=true});if(c)return}this.close()}}},_isSameElementOrChild:function(a,b){return a[0]==b[0]||jQuery(a).has(b).length===1},_addResizeListener:function(){this._registerGlobalResizeListener();var a=this;this.ncbipopperdocumentresizeFunction=function(b){a._pageResized(b)};jQuery(window).bind("ncbipopperdocumentresize",this.ncbipopperdocumentresizeFunction)},_destroyResizeListener:function(){if(this.ncbipopperdocumentresizeFunction){jQuery(window).unbind("ncbipopperdocumentresize",this.ncbipopperdocumentresizeFunction);
469 this.ncbipopperdocumentresizeFunction=null}},_registerGlobalResizeListener:function(){if(!jQuery.ui.ncbipopper.globalEvents.isGlobalResizeRegistered){jQuery.ui.ncbipopper.globalEvents.isGlobalResizeRegistered=true;jQuery(window).on("resize scroll",function(){jQuery(window).trigger("ncbipopperdocumentresize")})}},_pageResized:function(a){if(this.isOpen()){this._positionPopper(a);this._setUpArrow(a)}},_addCloseButton:function(){if(this.options.addCloseButton){var a=this.getDestElement(),b=a.find(".ui-ncbipopper-close-button, .ncbipopper-close-button");
470 if(b.length===0){b=jQuery("<button class='ui-ncbipopper-close-button ui-ncbipopper-close-button-generated'>x</button>").attr("generated","true").prependTo(a);b.ncbibutton({color:"blue"})}if(b){var c=this;this._closeButtonFunction=function(d){c.close();d.preventDefault()};b.on("click",this._closeButtonFunction)}}},_destroyCloseButton:function(a){this._closeButtonFunction&&this.getDestElement().find(".ui-ncbipopper-close-button, .ncbipopper-close-button").off("click",this._closeButtonFunction).filter(function(){return!a}).filter(".ui-ncbipopper-close-button-generated").ncbibutton("destroy").remove()},
471 isPopperShared:function(){return(this.getDestElement().data("popperTriggers")||[]).length>1},_addSharingDetails:function(){var a=this.getDestElement(),b=a.data("popperTriggers")||[];b.push(this.element);a.data("popperTriggers",b)},_removeSharingDetails:function(){for(var a=this.getDestElement(),b=a.data("popperTriggers"),c=this.element[0],d=0;d<b.length;d++)if(b[d][0]==c){b.slice(d,1);break}b.length===0?a.removeData("popperTriggers"):a.data("popperTriggers",b)},_handleSharedPoppersOpen:function(){if(this.isPopperShared())for(var a=
472 this.getDestElement().data("popperTriggers"),b=this.element[0],c=0;c<a.length;c++)if(a[c][0]!=b&&jQuery.ui.jig.getElementWidgets(a[c],"ncbipopper")[0].isOpen()){jQuery.ui.jig.getElementWidgets(a[c],"ncbipopper")[0].close(true);break}},_addPopperHover:function(){if((this.options.closeMethod||this.options.closeEvent)==="mouseout"){var a=this.getDestElement();if(this._arrow)a=a.add(this._arrow);var b=this,c={timeout:this.options.delayTimeout,over:function(){},out:function(){b._overPopper(false)}};jQuery(a).hoverIntent(c);
473 jQuery(a).mouseenter(function(){b._overPopper(true);b._lastOver=new Date});jQuery(a).mouseleave(function(){new Date-b._lastOver<b.options.delayTimeout&&b._overPopper(false)}).mouseout(function(d){var f=jQuery(d.target||d.srcElement);if(f.hasClass("ui-ncbipopper-wrapper")||f.hasClass("ui-ncbipopper-arrow-image"))if(f.find(d.relatedTarget).length===0){b._isOverPopper=false;b._outTimer=window.setTimeout(function(){b._overPopper(false)},200)}})}},_destroyPopperHover:function(){var a=jQuery(this.getDestElement());
474 a.unbind("mouseenter").unbind("mouseleave");a.removeProp("hoverIntent_t");a.removeProp("hoverIntent_s")},_overPopper:function(a){this._outTimer&&window.clearInterval(this._outTimer);if(a)this._pTimer=new Date;this._isOverPopper=a;if(!a)if(this._isOverTrigger){var b=this;window.setTimeout(function(){!b._isOverPopper&&!b._isOverTrigger&&b._overPopper(false)},300)}else this.close()},isOpen:function(a){if(!a)a=this._activeTrigger;a=jQuery(a);var b=jQuery(this._activeTrigger),c=this.getDestElement().data("popperTriggers");
475 a=this.options.openAtTarget||c.length>1?a&&a.length&&b&&b.length&&b[0]===a[0]:true;return this.getDestElement().data("isOpen")&&a?true:false},_setParentsZIndex:function(a){if(jQuery.browser.msie&&parseInt(jQuery.browser.version,10)<=7){var b=this.getDestElement().parents(),c=0;if(b.length>1){b.each(function(f){if(jQuery(this).css("position")==="relative"){c=f===0?0:f+1;return false}});b=b.eq(c);var d=b.css("position");b.data("orgPosition")||b.data("orgPosition",d);if(d==="static"||d==="relative"){d=
476 a===1?b.data("orgPosition"):"relative";b.css({position:d,"z-index":a})}}}},addTriggerAria:function(a){var b=a;if(!a){b=this.element;if((a=this.options.multipleHandlesSelector)&&a.length>0)b=b.add(a)}b.attr("role","button").attr("aria-expanded",false).attr("aria-haspopup",true)},_destroyTriggerAria:function(){var a=this.element,b=this.options.multipleHandlesSelector;if(b&&b.length>0)a=a.add(b);a.removeAttr("role aria-expanded aria-haspopup")},_addDestAria:function(){this.getDestElement().attr("aria-live",
477 "assertive").attr("aria-hidden",true).addClass("ui-helper-reset")},_destroyDestAria:function(){this.getDestElement().removeAttr("aria-live aria-hidden").removeClass("ui-helper-reset")},_setAriaState:function(a,b,c){b=b?b:this.element;c=c?c:this.getDestElement();b.attr("aria-expanded",a);c.attr("aria-hidden",!a)}});jQuery.ui.ncbipopper.openGroups={};jQuery.ui.ncbipopper.globalEvents={isGlobalEscapeRegistered:false,isGlobalClickRegistered:false,isGlobalResizeRegistered:false};
478 (function(a){a.widget("ui.ncbislideshow",{options:{fadeSpeed:500,slideInterval:4E3,currentSlide:1,height:"117px",width:"410px",randomStart:false},_create:function(){this.element.addClass("ui-ncbislideshow").children("ul").addClass("ui-ncbislideshow-slides");this.options.slideCount=this.element.find("ul.ui-ncbislideshow-slides > li").length;this.options.randomStart&&this._setRandomStart();this.element.append(this._generateSkipList());this.element.find("ul.ui-ncbislideshow-slides").height(this.options.height).width(this.options.width);
479 this.element.find(".ui-ncbislideshow-skip li a:eq("+this.options.currentSlide+")").addClass("active");this.element.find(".ui-ncbislideshow-slides li").hide();this.element.find(".ui-ncbislideshow-slides li:nth-child("+this.options.currentSlide+")").show();this.startAnimation()},_setRandomStart:function(){this.element.ncbislideshow("option","currentSlide",Math.floor(Math.random()*this.options.slideCount+1))},startAnimation:function(){var b=this;this.element.find("span.ui-icon").addClass("ui-icon-pause").removeClass("ui-icon-play").attr("title",
480 "click to pause");this.options.animTimeout=setTimeout(function(){b._rotateSlides()},this.options.slideInterval)},stopAnimation:function(){this.element.find("span.ui-icon").addClass("ui-icon-play").removeClass("ui-icon-pause").attr("title","click to play");clearTimeout(this.options.animTimeout);delete this.options.animTimeout},_rotateSlides:function(){this._advanceSlide();this.startAnimation()},_advanceSlide:function(){var b=this.options,c=this.element;if(b.currentSlide>=this.options.slideCount)b.currentSlide=
481 1;else b.currentSlide++;c.find(".ui-ncbislideshow-slides li:visible").fadeOut(b.fadeSpeed);c.find(".ui-ncbislideshow-slides li:nth-child("+b.currentSlide+")").fadeIn(b.fadeSpeed);c.find(".ui-ncbislideshow-skip > li > a").removeClass("active");c.find(".ui-ncbislideshow-skip li a:eq("+b.currentSlide+")").addClass("active")},skiptoSlide:function(){var b=this.options,c=this.element;c.find(".ui-ncbislideshow-slides li:visible").fadeOut(b.fadeSpeed);c.find(".ui-ncbislideshow-slides li:nth-child("+b.currentSlide+
482 ")").fadeIn(b.fadeSpeed);c.find(".ui-ncbislideshow-skip > li > a").removeClass("active");c.find(".ui-ncbislideshow-skip li a:eq("+b.currentSlide+")").addClass("active");if(this.options.animTimeout){this.stopAnimation();this.startAnimation()}},_generateSkipList:function(){var b=this,c=this.options,d=a("<a>").attr("href","#").attr("tabindex","-1").append(a("<span>").attr("title","click to pause").addClass("ui-icon ui-icon-pause")).bind("click",function(g){c.animTimeout?b.stopAnimation():b.startAnimation();
483 g.preventDefault()}),f=a("<ul>").width(c.width).addClass("ui-ncbislideshow-skip").append(a("<li>").addClass("ui-ncbislideshow-playPause").append(d));this.element.find("ul.ui-ncbislideshow-slides > li").each(function(g){var i=g+1;g=a("<a>"+i+"</a>").attr("href","#").attr("tabindex","-1").bind("click",function(e){if(b.options.currentSlide!==i){b.options.currentSlide=i;b.skiptoSlide();e.preventDefault()}});f.append(a("<li>").append(g))});return f},destroy:function(){this.element.find(".ui-ncbislideshow-slides li").show();
484 this.stopAnimation();this.element.children(".ui-ncbislideshow-skip").remove();this.element.removeClass("ui-ncbislideshow").children("ul").removeClass("ui-ncbislideshow-slides");a.Widget.prototype.destroy.apply(this,arguments)}});a.ui.ncbislideshow.prototype.version="2.0"})(jQuery);
485 (function(a){a.widget("ui.ncbitoggler",{styles:{ariaWrapper:"ui-ncbitoggler-live",groupMasterReplaceNode:"span.ui-ncbitoggler-group-replace-txt",groupMasterStateClose:"ui-ncbitoggler-group-master-to-close",groupMasterStateOpen:"ui-ncbitoggler-group-master-to-open",master:"ui-ncbitoggler",masterOpen:"ui-ncbitoggler-open",target:"ui-ncbitoggler-slave",targetOpen:"ui-ncbitoggler-slave-open",icon:"ui-icon-triangle-1-e",iconOpen:"ui-icon-triangle-1-s",iconPlusMinusBig:"ui-icon-plus-minus-big",iconPlusMinusBigOpen:"ui-icon-plus-minus-big-open",
486 iconArrowStop:"ui-icon-arrowthickstop-1-s",iconArrowStopOpen:"ui-icon-arrowthickstop-1-n"},options:{animation:"slide",closedAppendText:"",cookieNamePrefix:"jig-tog-rem-",indicator:"small-arrow",initOpen:false,isIcon:true,liveRegions:true,openedAppendText:"",remember:false,speed:50,targets:""},_cachedTargetData:{},_create:function(){this._setOption("disabled",false);this.appendTextNode=this.initTargetsClass=this.iconSpan=this.startOpen=this.rememberCookie=this.remember=this.cookieName=this.addedHref=
487 null;var b=this.element,c=b[0],d=this.styles,f=this,g=this.options.isIcon;b.data("isOpen",false);b.addClass("ui-widget ui-ncbitoggler");g||b.addClass("ui-ncbitoggler-no-icon");var i=b.attr("href");!i?(this.addedHref=true):(this.addedHref=false);this._validate(i);b.children("span.ui-ncbitoggler-master-text").length===0&&b.contents().filter(function(){return this.nodeType===3}).each(function(){var e=a(this);jQuery.trim(this.nodeValue).length>0&&e.wrap('<span class="ui-ncbitoggler-master-text"></span>')});
488 if(this.options.openedAppendText!==""||this.options.closedAppendText!==""){this.appendTextNode=b.children("span.ui-ncbitoggler-appended-text");if(this.appendTextNode.length===0)if(!this.initOpen){this.appendTextNode=a('<span class="ui-ncbitoggler-appended-text">'+this.options.closedAppendText+"</span>");b.find(".ui-ncbitoggler-master-text").after(this.appendTextNode)}}if(this.remember=this.options.remember||false){i=this.element.attr("id");if(!i){window.console&&console.error&&console.error("ncbitoggler: master node "+
489 c+" must have a unique id attribute when remembering state");return}this.cookieName=this.options.cookieNamePrefix+i;this.rememberCookie=a.cookie(this.cookieName)}if(this.startOpen=this.rememberCookie?this.rememberCookie==="open"?true:false:b.hasClass("jig-ncbitoggler-open")||b.hasClass(d.masterOpen)||this.options.initOpen?true:false){b.removeClass(this.styles.master);b.addClass(d.masterOpen);this._targetsOpen=true}else{b.removeClass(this.styles.masterOpen);b.addClass(d.master)}g&&this._initMasterIcon();
490 this.targets=this._getTargets();this.targets.addClass("ui-ncbitoggler").removeClass("ui-ncbitoggler-disabled ui-state-disabled");if(this.startOpen){this.targets.removeClass(d.target);this.targets.addClass(d.targetOpen);this.initTargetsClass=d.targetOpen}else{this.targets.removeClass(d.targetOpen);this.targets.addClass(d.target);this.initTargetsClass=d.target}this._initAria();this._doGrouping();b.click(function(e){f.toggle(e,f)});this._saveReferences()},_getGroupMaster:function(){for(var b=this.styles,
491 c=this.element[0].className.split(/\s+/),d=0;d<c.length;d++){var f=c[d].match(/ui-ncbitoggler-group-(.+)$/);if(f){f=f[1];var g=a("a.ui-ncbitoggler-group-open-"+f+", a.ui-ncbitoggler-group-close-"+f,this.options.contextNode);if(g.length===1){g.hasClass("ui-ncbitoggler-group-open-"+f)&&g.addClass(b.groupMasterStateOpen);g.hasClass("ui-ncbitoggler-group-close-"+f)&&g.addClass(b.groupMasterStateClose);return g}}}},_doGrouping:function(){var b=this._getGroupMaster();if(b){var c=this,d=this.styles,f=b.data("togglers");
492 this.element.id||a.ui.jig._generateId(this.widgetName);if(!this.element[0].id)this.element[0].id=a.ui.jig._generateId(this.widgetName);if(typeof f==="undefined"){b.data("togglers",[]);b.data("togglers").push(this.element)}else f.push(this.element);var g=b.find(d.groupMasterReplaceNode);b.click(function(i){i.preventDefault();i=b.data("togglers");i=i[i.length-1][0];if(b.hasClass(d.groupMasterStateOpen)){c.open();g.length>0&&g.text(c.options.groupMasterCloseReplaceText);c.element[0]===i&&b.removeClass(d.groupMasterStateOpen).addClass(d.groupMasterStateClose)}else{c.close();
493 g.length>0&&g.text(c.options.groupMasterOpenReplaceText);c.element[0]===i&&b.removeClass(d.groupMasterStateClose).addClass(d.groupMasterStateOpen)}})}},_initAria:function(){var b=this.startOpen;this.element.attr({role:"button","aria-expanded":b});this.options.liveRegions&&this.targets.each(function(){var c=a(this);c.find("table").length===0&&!c.parent("div").hasClass("ui-helper-reset")&&c.wrap('<div class="ui-helper-reset" aria-live="assertive">');c.attr("aria-hidden",b?"false":"true")})},_validate:function(b){var c=
494 this.element,d=["a"],f=c[0].tagName.toLowerCase();if(a.inArray(f,d)===-1)throw new Error("ncbitoggler: master node must be one of the following elements: "+d.toString());b||c.attr("href","#")},_initMasterIcon:function(){var b=this.element,c=this.styles;if(this.options.indicator=="plus-minus-big"){this.iconOpenClass=c.iconPlusMinusBigOpen;this.iconCloseClass=c.iconPlusMinusBig}else if(this.options.indicator=="arrow-stop"){this.iconOpenClass=c.iconArrowStopOpen;this.iconCloseClass=c.iconArrowStop}else{this.iconOpenClass=
495 c.iconOpen;this.iconCloseClass=c.icon}this.iconSpan=b.find("span.ui-icon");if(this.iconSpan.length===0){this.iconSpan=a('<span class="ui-icon"></span>');this.startOpen?this.iconSpan.addClass(this.iconOpenClass):this.iconSpan.addClass(this.iconCloseClass);b.append(this.iconSpan)}else if(this.startOpen){this.iconSpan.removeClass(this.iconCloseClass);this.iconSpan.addClass(this.iconOpenClass)}},getSlaves:function(){return this._targets},getTargets:function(){return this.getSlaves()},_getTargets:function(){var b=
496 this.element,c=b.attr("toggles")||b.attr("data-ncbitoggler-toggles");if(c)jQuery.ui.jig._isConsole("warn")&&console.warn('The attributes "toggles" and "data-ncbitoggler-toggles" are deprecated. Please use the "targets" attribute instead (see documentation).');else c=this.options.targets;if(c&&typeof c=="object"){c=c;b="";for(var d in c)b+=d+", ";b=b.replace(/,\s$/,"");d=a(b)}else if(c){d=a(c);if(d.length===0){this.isSibling=false;d=c.split(/ +/);c="";for(b=0;b<d.length;b++)c+=b!==d.length-1?"#"+d[b]+
497 ",":"#"+d[b];d=a(c)}}else if(b.parent(":header").length>0){b.parent(":header").parent().css("zoom","1");this.isSibling=true;d=b.parent(":header").css("zoom","1").next()}else{this.isSibling=true;d=b.next()}return this._targets=this._normalizeTargets(d)},_normalizeTargets:function(b){var c=[];b.each(function(){var d=this,f=a(this);if(f.hasClass("ui-helper-reset"))d=f.children().get(0);c.push(d)});return ret=a(c)},_getCachedTargetData:function(b){return this._cachedTargetData[b]},_cacheTargetData:function(b,
498 c){this._cachedTargetData[b]=c},_openAjaxTarget:function(b,c){var d=this,f=this._getCachedTargetData(b);f?a(b).html(f):a.get(c,function(g){d._cacheTargetData(b,g);a(b).html(g)})},_openTargets:function(){if(!(this._targetsOpening||this._targetsClosing||this._targetOpen)){this._targetsOpening=true;var b=this.targets,c=this.styles;b.removeClass(c.target).addClass(c.targetOpen).attr("aria-hidden","false");var d=this.options.targets;if(typeof d=="object"){var f=this;for(targetSel in d)(function(g){f._openAjaxTarget(g,
499 d[g])})(targetSel)}c=this.options.openedAppendText;c!==""&&this.appendTextNode.html(c);b.css("display","");this._targetsOpening=false;this._targetsOpen=true}},_closeTargets:function(){if(!(this._targetsOpening||this._targetsClosing||!this._targetsOpen)){this._targetsClosing=true;var b=this.targets,c=this.styles;b.removeClass(c.targetOpen).addClass(c.target).attr("aria-hidden","true");c=this.options.closedAppendText;c!==""&&this.appendTextNode.html(c);b.css("display","");this._targetsOpen=this._targetsClosing=
500 false}},_fixHasLayout:function(b){window.setTimeout(function(){b.targets.addClass("foo").removeClass("foo")},1)},open:function(b){var c=this.element,d=this;if(!c.hasClass(this.styles.master))return c;this.updateState("open");if(this.options.animation==="slide")this.targets.slideToggle(this.options.speed,function(){d._openTargets();a.browser.msie&&d._fixHasLayout(d);c.data("isOpen",true);c.trigger("ncbitoggleropen");b&&b()});else{this._openTargets();a.browser.msie&&d._fixHasLayout(d);c.data("isOpen",
501 true);c.trigger("ncbitoggleropen");b&&b()}this._updateReferences("open");return c},close:function(b){var c=this.element,d=this;if(!c.hasClass(this.styles.masterOpen))return c;this.updateState("closed");if(this.options.animation==="slide")this.targets.slideToggle(this.options.speed,function(){d._closeTargets();c.trigger("ncbitogglerclosed").trigger("ncbitogglerclose");c.data("isOpen",false);b&&b()});else{this._closeTargets();c.data("isOpen",false);c.trigger("ncbitogglerclosed");b&&b()}this._updateReferences("closed");
502 return c},toggle:function(b,c,d){var f=arguments.length;if(f===0||f===1){c=this;if(f===1)d=arguments[0]}else b.preventDefault();this.element.hasClass(this.styles.master)?c.open(d):c.close(d)},updateState:function(b){var c=this.element;b||(b=c.hasClass(styles.master)?"open":"closed");var d=this.styles.master,f=this.styles.masterOpen,g=this.iconCloseClass,i=this.iconOpenClass;if(b=="closed"){d=this.styles.masterOpen;f=this.styles.master;g=this.iconOpenClass;i=this.iconCloseClass}c.removeClass(d).addClass(f).attr("aria-expanded",
503 b=="closed"?"false":"true");this.options.isIcon&&this.iconSpan.removeClass(g).addClass(i);this.remember&&a.cookie(this.cookieName,b)},_removeHandlers:function(){this.element.unbind("click")},destroy:function(){a.Widget.prototype.destroy.apply(this,arguments);var b=this.element,c=this.styles;b.removeClass(c.master+" "+c.masterOpen+" ui-state-disabled ui-widget ui-ncbitoggler-disabled").removeAttr("role").removeAttr("aria-expanded");this.targets.removeClass("ui-ncbitoggler ui-ncbitoggler-slave ui-ncbitoggler-slave-open ui-state-disabled ui-ncbitoggler-disabled");
504 this.targets.removeAttr("aria-hidden");if(this.options.isIcon){c=b.find("span.ui-icon")[0];b[0].removeChild(c)}this.targets.each(function(){var f=jQuery(this),g=f.parent("div.ui-helper-reset");if(g.length>0){f.insertBefore(g);g.remove()}});c=b.find("span.ui-ncbitoggler-master-text");var d=c.html();c.remove();b.html(d);this._removeHandlers();return this},disable:function(){a.Widget.prototype.disable.apply(this,arguments);this._removeHandlers();this.targets.addClass("ui-ncbitoggler-disabled ui-state-disabled");
505 return this},enable:function(){a.Widget.prototype.enable.apply(this,arguments);this.targets.removeClass("ui-ncbitoggler-disabled ui-state-disabled");var b=this;this.element.click(function(c){b.toggle(c,b)});return this},_saveReferences:function(){var b=this;this._targets.each(function(){typeof a(this).data("ncbitoggler-masters")==="undefined"&&a(this).data("ncbitoggler-masters",[]);a(this).data("ncbitoggler-masters").push(b.element)})},_updateReferences:function(b){var c=this;a.each(this._targets.data("ncbitoggler-masters"),
506 function(){c.element!=this&&a(this).ncbitoggler("updateState",b)})}})})(jQuery);
507 (function(a){a.widget("ui.ncbitree_base",{options:{expanded:"",speed:120,remember:false},_create:function(){this.widgetId=this.element.prop("id")||jQuery.ui.jig._generateId("ncbitree");this.list=this.element.eq(0);this.list[0].nodeName=="UL"&&this._treeify();this.isLoaded=true},_treeify:function(){var b=this.list,c=this,d=this.options;b.attr({role:"tree"}).addClass("ui-widget");b.find("a:eq(0)").attr("tabindex","0");b.find("a:gt(0)").attr("tabindex","-1");var f=this.widgetId;b.find("ul").filter(function(){return jQuery(this).data("treeid")!==
508 f}).attr({role:"group"}).addClass("tree-group-collapsed").data("treeid",f);b.find("li").filter(function(){return jQuery(this).data("treeid")!==f}).attr({role:"treeitem"}).data("treeid",f).filter(":has(ul)").attr("aria-expanded","false");b.find("li:has(ul)").find(">a").wrap('<span class="tree-parent"/>').each(function(){var i=jQuery(this);i.attr("href")==="#"&&i.click(function(e){e.preventDefault();c._toggle(i.parent())})});if(!this.isLoaded){b.bind("expand.treeEvents",function(i){c._expand(i.target);
509 c._trigger("expand",i)}).bind("collapse.treeEvents",function(i){c._collapse(i.target);c._trigger("collapse",i)}).bind("toggle.treeEvents",function(i){c._toggle(i.target)}).bind("traverseDown.treeEvents",function(i){var e=a(i.target);e.length||(e=b.find("a[tabindex=0]"));e.length||(e=a(i.target));i=e.closest("li");if(i.is("[aria-expanded=true]"))i.find("ul[role=group]").find("a").eq(0).focus();else i.next().length?i.next().find("a").eq(0).focus():i.parents("li").next().find("a").eq(0).focus()}).bind("traverseUp.treeEvents",
510 function(i){var e=a(i.target);e.length||(e=b.find("a[tabindex=0]"));e.length||(e=a(i.target));i=e.closest("li");if(i.prev().length)i.prev().is("[aria-expanded=true]")?i.prev().find("li:visible:last a").eq(0).focus():i.prev().find("a").eq(0).focus();else i.parents("li:eq(0)").find("a").eq(0).focus()});b.bind("focus.treeEvents",function(i){b.find("[tabindex=0]").attr("tabindex","-1").removeClass("ui-state-focus");a(i.target).attr("tabindex","0").addClass("ui-state-focus")}).bind("click.treeEvents",
511 function(i){var e=a(i.target);if(e.is("span.tree-parent")){e.trigger("toggle");e.eq(0).focus();i.preventDefault()}}).bind("keydown.treeEvents",function(i){var e=a(i.target);if(i.keyCode==37||i.keyCode==38||i.keyCode==39||i.keyCode==40){i.keyCode==37&&e.closest("li").is("[aria-expanded=true]")&&e.closest("span.tree-parent").trigger("collapse");i.keyCode==39&&e.closest("li").is("[aria-expanded=false]")&&e.closest("span.tree-parent").trigger("expand");i.keyCode==38&&e.trigger("traverseUp");i.keyCode==
512 40&&e.trigger("traverseDown");return false}else if((i.keyCode==13||i.keyCode==32)&&e.closest("li").is("li[role=treeitem]")){e.closest("span.tree-parent").trigger("toggle");return false}});var g=b.attr("id");if(g&&a.cookie("ncbitree")&&a.parseJSON(a.cookie("ncbitree"))[g]){d=a.parseJSON(a.cookie("ncbitree"))[g];c._load_state(d)}else b.find(d.expanded).find(">span").each(function(){c._expand(this)})}b.find("li[role=treeitem] > a, li[role=treeitem] > span").filter(function(){return jQuery(this).data("treeid")!==
513 f}).addClass("ui-state-default").data("treeid",f).bind("mouseenter.treeEvents",function(){a(this).addClass("ui-state-hover")}).bind("mouseleave.treeEvents",function(){a(this).removeClass("ui-state-hover")})},_expand:function(b){var c=this.options,d=this,f=this.list,g=b?a(b):f.find("a[tabindex=0]");g.addClass("ui-state-active").removeClass("ui-state-default");g.siblings("ul").hide().removeClass("tree-group-collapsed").slideDown(c.speed,function(){a(this).removeAttr("style");g.parent().attr("aria-expanded",
514 "true").addClass("tree-expanded");c.remember&&d._save_state()})},_collapse:function(b){var c=this.options,d=this,f=this.list,g=b?a(b):f.find("a[tabindex=0]");g.removeClass("ui-state-active").addClass("ui-state-default");g.siblings("ul").slideUp(c.speed,function(){g.parent().attr("aria-expanded","false").removeClass("tree-expanded");a(this).addClass("tree-group-collapsed").removeAttr("style");c.remember&&d._save_state()})},_toggle:function(b){var c=this.list;b=b?a(b):c.find("a[tabindex=0]");b.parent().is("[aria-expanded=false]")?
515 b.trigger("expand"):b.trigger("collapse")},expand:function(b,c){var d=this.list;if(c){ancestor_spans=d.find(b).parentsUntil("[role=tree]").find(">span");ancestor_spans.each(function(){a(this).trigger("expand")})}d.find(b).find(">span").trigger("expand");this._trigger("expanded",null)},collapse:function(b){this.list.find(b).find(">span").trigger("collapse")},destroy:function(){a.Widget.prototype.destroy.apply(this,arguments);var b=this.list;b.removeAttr("role").removeClass("ui-widget");b.find("a").removeAttr("tabindex").removeClass("ui-state-focus ui-state-default ui-state-hover ui-state-active");
516 b.find("ul").removeAttr("role").removeClass("tree-group-collapsed");b.find("li").removeAttr("role").removeClass("tree-expanded");b.find("li:has(ul)").removeAttr("aria-expanded").find(">a").removeClass("tree-parent");b.find('span[class*="tree-parent"]>a').unwrap();b.find(this.options.expanded).removeAttr("aria-expanded");b.unbind(".treeEvents")},_load_state:function(b){var c=this,d=this.list;state=b.split("");d.find("li[aria-expanded]").each(function(f){state[f]==1?a(this).find(">span").each(function(){c._expand(this)}):
517 a(this).find(">span").each(function(){c._collapse(this)})})},_save_state:function(){var b=this.list,c=b.attr("id");if(c){state_data={};if(a.cookie("ncbitree"))state_data=a.parseJSON(a.cookie("ncbitree"));var d="";b.find("li[aria-expanded]").each(function(){d+=a(this).attr("aria-expanded")=="true"?"1":"0"});state_data[c]=d;data=JSON.stringify(state_data);a.cookie("ncbitree",data,{path:"/"})}}});a.ui.ncbitree_base.prototype.version="0.2"})(jQuery);
518 (function(a){a.widget("ui.ncbitree",a.ui.ncbitree_base,{options:{expanded:""},_create:function(){a.ui.ncbitree_base.prototype._create.call(this);this.list.addClass("jig-tree")},destroy:function(){this.list.removeClass("jig-tree");a.ui.ncbitree_base.prototype.destroy.call(this)},_getParentLis:function(){return this.list.find("li").has("ul")},expandAll:function(){this.expand(this._getParentLis())},collapseAll:function(){this.collapse(this._getParentLis())},refresh:function(){this._treeify()}});a.ui.ncbitree.prototype.version=
519 "0.1"})(jQuery);
520 jQuery.widget("ui.ncbismoothscroll",{options:{duration:1E3,easing:true,easingFunction:"",exclude:".ncbismoothscrollexclude",topHref:"#top",removeTopHash:true},_create:function(){this.element.prop("id")==""&&this.element.attr("id",jQuery.ui.jig._generateId(this.widgetName));this._determineScrollableElement();this._smoothScroll()},destroy:function(){this._removeSmoothScroll()},_smoothScroll:function(){if("onhashchange"in window&&(document.documentMode===undefined||document.documentMode>7)){var a="linear";
521 if(this.options.easing)if(this.options.easingFunction==""){typeof jQuery.easing.easeOutExpo!=="function"&&jQuery.extend(jQuery.easing,{easeOutExpo:function(b,c,d,f,g){return c==g?d+f:f*(-Math.pow(2,-10*c/g)+1)+d}});a="easeOutExpo"}else a=this.options.easingFunction;if(!jQuery.ui.ncbismoothscroll.globalEvents.isHashChangeRegistered){jQuery(window).on("hashchange.ncbismoothscroll",{scrollParent:jQuery(this.element),triggeredByLink:false,easing:a},function(b){b.data.scrollParent.data("ncbismoothscroll").scroll(b)});
522 jQuery.ui.ncbismoothscroll.globalEvents.isHashChangeRegistered=true}this.element.find('a[href^="#"]').not(this.options.exclude).on("click.ncbismoothscroll",{scrollParent:jQuery(this.element),triggeredByLink:true,easing:a},function(b){b.data.scrollParent.data("ncbismoothscroll").scroll(b)})}},_removeSmoothScroll:function(){jQuery(window).off("hashchange.ncbismoothscroll");this.element.find("a").not(this.options.exclude).off("click.ncbismoothscroll")},scroll:function(a){a.preventDefault();var b=a.data.triggeredByLink?
523 jQuery(a.target).attr("href"):window.location.hash,c=b==a.data.scrollParent.ncbismoothscroll("option","topHref")||b==""||b=="#"?0:jQuery(b.replace(".","\\.")).offset().top;if(jQuery(jQuery.ui.ncbismoothscroll.globalEvents.scrollableElement).scrollTop()!==c){a.data.scrollParent.trigger("ncbismoothscrollbeforescroll");jQuery(jQuery.ui.ncbismoothscroll.globalEvents.scrollableElement).stop().animate({scrollTop:c},a.data.scrollParent.ncbismoothscroll("option","duration"),a.data.easing,function(){a.data.scrollParent.trigger("ncbismoothscrollafterscroll");
524 if(a.data.triggeredByLink)if(c==0&&a.data.scrollParent.ncbismoothscroll("option","removeTopHash")&&window.history&&window.history.pushState)window.history.pushState("","",window.location.pathname);else window.location.hash=b})}},_scrollableElement:function(){for(var a=0,b=arguments.length;a<b;a++){var c=arguments[a],d=jQuery(c);if(d.scrollTop()>0)return c;else{d.scrollTop(1);var f=d.scrollTop()>0;d.scrollTop(0);if(f)return c}}return[]},_determineScrollableElement:function(){if(jQuery.ui.ncbismoothscroll.globalEvents.scrollableElement==
525 "")jQuery.ui.ncbismoothscroll.globalEvents.scrollableElement=this._scrollableElement("html","body")}});jQuery.ui.ncbismoothscroll.globalEvents={isHashChangeRegistered:false,scrollableElement:""};
526 (function(){jQuery.widget("ui.ncbilinksmenu",jQuery.ui.ncbipopper,{options:{openEvent:"click",closeEvent:"click",closeOnSelect:true,openAnimation:"none",cssClass:"ui-ncbilinksmenu",ignoreSettingOutterWidth:true,excludeBasicCssStyles:true,wrapElement:true,preventDefault:""},_create:function(){this._checkHrefForWebService();this._setPopperOptions();jQuery.ui.ncbipopper.prototype._create.apply(this,arguments);this._addMenuAria();this._addOpenEvents()},destroy:function(){this._destroyMenuAria();this._destroyMenu();
527 this._destroyOpenEvents();jQuery.ui.ncbipopper.prototype.destroy.apply(this,arguments)},_checkHrefForWebService:function(){if(!this.options.webservice&&!this.options.destSelector&&!this.options.localJSON)this.options.webservice=this.element.attr("href")},_setPopperOptions:function(){var a=this.options;if(a.loadingMessage)a.showLoadingMessage=true;if(!a.width)a.width="200px";if(this.options.webservice||this.options.localJSON)this.options.destText="<ul class='linksmenu-ul'><li class='ui-ncbilinksmenu-loadingMessage'><span>"+
528 this.options.loadingText+"</span></li></ul>"},open:function(){this._setTriggerId();if(this.isLoaded)this.getDestElement().find("ul").eq(0).ncbibasicmenu("removeAllSelections").ncbibasicmenu("focus");else{var a=this;if(this.options.webservice){var b=this.options.webservice,c=this.options.webserviceMenuSelector;if(!c)if(b.indexOf("#")!==-1)c=b.match(/#.+/)[0];jQuery.get(b,function(d){if(typeof d==="string"){var f=d;if(c)f=jQuery("<div/>").html(d).find(c);a.getDestElement().empty().html(f);a._createMenu()}else a._loadContentJSON(d)}).error(function(){a.getDestElement().find("ul.linksmenu-ul").replaceWith("<ul class='linksmenu-ul'><li class='ui-ncbilinksmenu-errorMessage'><span>Error Loading Data</span></li></ul>");
529 a._logError();window.setTimeout(function(){a.close()},4E3)})}else if(this.options.localJSON){b=this.options.localJSON;if(typeof b==="function")b=b();this._loadContentJSON(b)}else this._createMenu()}jQuery.ui.ncbipopper.prototype.open.apply(this,arguments)},_addMenuAria:function(){this.element.wrap("<span></span>").attr("role","menuitem").parent().attr("role","menubar")},_destroyMenuAria:function(){this.element.unwrap().removeAttr("role")},_createMenu:function(){this.isLoaded=true;var a=this.getDestElement().find("ul").eq(0);
530 if(!a.hasClass("ui-ncbibasicmenu")){a.ncbibasicmenu({stopPropagationCheck:false,normalizeSubsToOneLevel:true,disableSelect:true});var b=this,c=function(d){var f=a.closest(".ui-ncbilinksmenu").data("attachedTo"),g=jQuery.ui.jig.getElementWidgets(f,"ncbilinksmenu")[0];g||(g=b);if(g.isOpen()){d.type!="ncbibasicmenuescape"&&g.options.closeOnSelect&&g.close();a.not(jQuery(d.target)).find("li.selected").not(jQuery(d.target).closest("li")).removeClass("selected");d.type!="ncbibasicmenuescape"&&g.options.closeOnSelect&&
531 f.focus()}};this._selectedFnc=c;a.on("ncbibasicmenuescape",c);a.on("click","a",c)}},_destroyMenu:function(){var a=this.getDestElement().find("ul").eq(0);a.ncbibasicmenu("destroy");a.ncbibasicmenu("focus").off("ncbibasicmenuescape",this._selectedFnc).off("ncbibasicmenuenter",this._selectedFnc).off("click",this._selectedFnc);this._selectedFnc=null},_loadContentJSON:function(a){function b(g,i){var e=g.text,h=g.href||"#",j=g.target||"",k=g.click||"";if(typeof k=="string"&&k!=""){eval("clicktmp = "+k);
532 k=clicktmp}var l=g.rel||"";if(j)j=' target="'+j+'"';if(l)l=' rel="'+l+'"';g=jQuery("<li></li>");e=jQuery("<a href='"+h+"'"+j+l+">"+e+"</a>");if(k)try{e.click(function(s){k.call(this,s,d);s.preventDefault&&jQuery(this).is(d.options.preventDefault)&&s.preventDefault()})}catch(n){typeof console!=="undefined"&&console.error&&console.error(n)}g.append(e);i.append(g)}function c(g,i){for(var e=0;e<g.length;e++){var h=g[e],j=h.heading;if(j){var k=jQuery("<li></li>").attr("role","heading");j=jQuery("<span>"+
533 j+"</span>");k.append(j);if(h=h.links){j=jQuery("<ul></ul>");c(h,j);k.append(j)}i.append(k)}else b(h,i)}}typeof a==="function"&&a.apply(this);var d=this,f=jQuery("<ul></ul>");(a=a.links)&&c(a,f);this._contentFetched=true;this.isFunctionResultCached=this.options.isDestTextCacheable;this.getDestElement().empty().append(f);this._createMenu();this._trigger("jsonmenuloaded")},_logError:function(){if(typeof ncbi!=="undefined"&&ncbi.sg&&ncbi.sg.ping){var a={jsevent:"ncbilinksmenu_error"},b=this.element,
534 c=b.attr("id")||null,d=b.attr("href")||null;b=b.text()||null;var f=this.options.webservice;if(c)a.id=c;if(d)a.href=d;if(b)a.text=b;if(f)a.webservice=f;ncbi.sg.ping(a)}},_setTriggerId:function(){var a=this.element.attr("id");a&&this.getDestElement().data("triggerId","#"+a).attr("data-jigtriggerid","#"+a).data("trigger",this.element)},_pingDetails:function(a,b,c){typeof ncbi!=="undefined"&&ncbi.sg&&ncbi.sg.ping&&ncbi.sg.ping(b,a.originalEvent,c,{})},_addOpenEvents:function(){var a=this;this._keyDownFnc=
535 function(b){b=b.keyCode;if(b===38||b===40)a.open()};this.element.on("keydown",this._keyDownFnc)},_destroyOpenEvents:function(){this.element.off("keydown",this._keyDownFnc);this._keyDownFnc=null}})})();
536 jQuery.widget("ui.ncbiclearbutton",{_create:function(){this._createButton();this._attachInputEvents();this._attachButtonEvents();this._boxShadow();this._showIfValue()},_wrapHTML:'<div class="jig-ncbiclearbutton-wrap" />',_buttonHTML:'<a class="reset" href="#"><img src="'+jQuery.ui.jig._baseURL+'img/clear.png" alt="Clear input" /></a>',_createButton:function(){this.clearButton=jQuery(this._buttonHTML);this.wrapperElement=jQuery(this._wrapHTML);this.element.wrap(this.wrapperElement);this.element.after(this.clearButton)},
537 clearText:function(){this.element.val("");this._trigger("elementcleared")},_showButton:function(){this.clearButton.css("visibility","visible")},_hideButton:function(){this.clearButton.css("visibility","hidden")},_boxShadow:function(){var a=this;this.element.focus(function(){a.element.parent().addClass("box-shadow")});this.element.blur(function(){a.element.parent().removeClass("box-shadow")})},_showIfValue:function(){this.element.val()!=""?this._showButton():this._hideButton()},_attachInputEvents:function(){var a=
538 this;this.element.bind("keyup change",function(){a._showIfValue()}).bind("paste",function(){window.setTimeout(function(){a._showIfValue()},10)})},_pingData:function(){typeof ncbi!=="undefined"&&ncbi.sg&&ncbi.sg.ping({jsevent:"ncbiclearbutton",prevValue:this.element.val()})},_attachButtonEvents:function(){var a=this;this.clearButton.click(function(b){a.clearText();a._hideButton();a.element.focus();b.preventDefault()})}});
539 jQuery.widget("ui.ncbiplaceholder",{options:{},_label:null,_create:function(){if(!jQuery.ui.ncbiplaceholder.hasPlaceholderSupport()){var a=this.element.attr("type");a=="hidden"||a=="button"||a=="submit"||a=="radio"||a=="checkbox"||a=="image"||a=="reset"||this._doFakeLabel()}},destroy:function(){this._removeFakeLabel()},_doFakeLabel:function(){var a=this;this.element.closest(".ui-dialog, .ui-ncbipopper-basic").length>0?jQuery(document).on("ncbidialogopen ncbipopperopencomplete",function(){a._fakeLabel(a)}):
540 this._fakeLabel(this)},_fakeLabel:function(a){var b=a.element.offset(),c=a.element.outerWidth(),d=a.element.outerHeight(),f=parseInt(a.element.css("borderTopWidth"),0),g=parseInt(a.element.css("borderLeftWidth"),0),i=a.element.attr("placeholder").replace(/<br\s?\/?>/,"");this._label=jQuery('<label class="ui-ncbiplaceholder-label" aria-hidden="true">'+i+"</label>").insertAfter(a.element).offset({top:b.top+f,left:b.left+g}).css({width:c,height:d});jQuery(["paddingTop","paddingRight","paddingBottom",
541 "paddingLeft","fontSize","lineHeight","fontFamily","width","fontWeight"]).each(function(){a._label.css(a.toString(),a.element.css(a.toString()))});a.element.val().length!==0&&a._label.hide();a._label.on("click",function(){a.element.focus()});a.element.on("focus.ncbiplaceholder",function(){a._label.hide()});a.element.on("blur.ncbiplaceholder",function(){a.element.val().length===0&&a._label.show()})},_removeFakeLabel:function(){this._label.remove();this.element.off("blur.ncbiplaceholder");this.element.off("focus.ncbiplaceholder")},
542 value:function(){return this.element.val()},hasValue:function(){return this.element.val().length!==0}});jQuery.ui.ncbiplaceholder.hasPlaceholderSupport=function(){var a=document.createElement("input"),b="placeholder"in a;a=null;jQuery.ui.ncbiplaceholder.hasPlaceholderSupport=function(){return b};return b};
543 jQuery.widget("ui.ncbiexpander",{options:{openDelay:200,delayTimeout:400,animationSpeed:200,minHeight:"55px"},_create:function(){this._wrapperInner();this._setHeightAndClass();if(this.isExpanable){this._addArrow();this._setArrowDirection("closed");this._hookUpEvents()}},destroy:function(){var a=this.element,b=a.find("div.ui-ncbiexpander"),c=b.html();b.remove();a.html(c);a.find("ui-expander-arrow-bar").remove()},_wrapperInner:function(){this._wrapper=this.element.wrapInner("<div class='expanderWrapper'></div>").find(".expanderWrapper")},
544 _setHeightAndClass:function(){this._wrapper.addClass("ui-ncbiexpander").height(this.options.minHeight);(this.isExpanable=this._wrapper[0].scrollHeight>this._wrapper.height())||this._wrapper.addClass("ui-ncbiexpander-simple").height("auto")},_hookUpEvents:function(){var a=this;if(this.isExpanable){this.element.hoverIntent({interval:this.options.openDelay,timeout:this.options.delayTimeout,over:function(){a._isOpen=true;var b=a._wrapper[0].scrollHeight;a._wrapper.stop().animate({height:b},a.options.animationSpeed,
545 function(){a._setArrowDirection("open")})},out:function(){a._isOpen=false;a._wrapper.stop().animate({height:a.options.minHeight},a.options.animationSpeed,function(){a._setArrowDirection("closed")})}});this.element.mouseenter(function(){a._setIconBarStyle(true)}).mouseleave(function(){a._isOpen||a._setIconBarStyle(false)})}},_addArrow:function(){this._iconBar=jQuery('<div class="ui-expander-arrow-bar"><div class="bar closed"><div class=""></div></div></div>').appendTo(this.element)},_setArrowDirection:function(a){var b=
546 a==="open"?"closed":"open";this._iconBar.find("div.bar").addClass(a).removeClass(b);this._setIconBarStyle(a==="open")},_setIconBarStyle:function(a){this._iconBar[a?"addClass":"removeClass"]("ui-expander-arrow-bar-active")}});
547 jQuery.widget("ui.ncbiselect",{_create:function(){this._buildSelect()},update:function(){this._buildSelect(true)},_buildSelect:function(a){this._setDefaults();this._makeList(a);a||this._setUpKeyListeners();this._setUpClickListeners();this._addFocusListener();this._addMultiSelectListener();this._scrollSelectionIntoView();this.element.hide()},_setDefaults:function(){this.isMultiple=this.element.prop("multiple")},_makeList:function(){var a=this,b=jQuery("<ul class='ui-ncbiselect'></ul>");this.activeOption=
548 -1;this.selectedOptions=[];var c=this.element[0].selectedIndex;this.element.find("option").each(function(d){var f=jQuery(this),g=f.is(":selected");if(g){a.activeOption=d;a.selectedOptions.push(d)}b.append("<li><a data-selIndex='"+d+"' href='#'"+(g||d===0&&c===-1?"":" tabindex='-1'")+(g?' class="ui-ncbiselect-item-active"':"")+">"+f.text()+"</a></li>")});this._ul?this._ul.replaceWith(b):this.element.after(b);this._ul=b;this.selectItems=b.find("li")},_addFocusListener:function(){var a=this;this.isFocused=
549 false;this.selectItems.find("a").focus(function(){a.isFocused=true;a.lastFocused=this}).blur(function(){if(this===a.lastFocused)a.isFocused=false})},_addMultiSelectListener:function(){function a(){b.update()}var b=this;this.element.bind("ncbilinkedselectspopulated",a)},_setUpKeyListeners:function(){if(!this._menukeylistener){var a=this;this._menukeylistener=function(b){a.isFocused&&a._moveMenuOption(b.keyCode,b)&&b.preventDefault()};jQuery(document).keydown(this._menukeylistener)}},_destroyKeyListeners:function(){if(this._menukeylistener){jQuery(document).unbind("keydown",
550 this._menukeylistener);this.activeOption=null}},_keys:{up:38,down:40,enter:13,space:32},destroy:function(){this._ul.remove();this.element.show()},_moveMenuOption:function(a,b){var c=b.ctrlKey||b.metaKey;b=b.shiftKey;var d=false;d=this._keys;switch(a){case d.up:this._moveSelection(-1,c,b);d=true;break;case d.down:this._moveSelection(1,c,b);d=true;break;case d.enter:d=false;break;case d.space:this._spaceClicked(c,b);d=true;break;default:d=false}return d},_moveSelection:function(a,b,c){var d=this.selectItems.find("a");
551 if(this.activeOption===undefined||this.activeOption===null)this.activeOption=-1;else if(!this.isMultiple||!b&&!c||c&&this._previousIsCtrl)this._removePreviousSelection();var f=this.activeOption;this.activeOption+=a;a=d.length;if(this.activeOption<0)this.activeOption=0;else if(this.activeOption>=a)this.activeOption=a-1;a=this.activeOption;if(b)this._focusOption(a);else{if(this._previousIsCtrl&&c){this.selectedOptions.push(f);this.selectOption(f)}this.selectedOptions.push(a);this.selectOption(a)}this._previousIsCtrl=
552 b;this.previousShift=undefined},_spaceClicked:function(a,b){!this.isMultiple||b||(this.selectedOptions.length>1&&a||!this.element.find("option").eq(this.activeOption).prop("selected")?this._selectOptionClick(this.activeOption,{ctrlKey:true,shiftKey:false}):this._selectOptionClick(this.activeOption,{ctrlKey:false,shiftKey:false}))},_setUpClickListeners:function(){var a=this,b=this.selectItems.find("a");jQuery.browser.msie&&parseInt(jQuery.browser.version,10)<=7&&b.mousedown(function(){jQuery(this).removeAttr("href")}).mouseup(function(){jQuery(this).attr("href",
553 "#");this.blur();this.focus();return false});b.click(function(c){var d=jQuery(this).data("selindex");a._selectOptionClick(d,c);c.preventDefault()})},_selectOptionClick:function(a,b){if(this.isMultiple){var c=b.shiftKey;if(b.ctrlKey||b.metaKey){this.previousShift=undefined;if(this.element.find("option").eq(a).prop("selected")){this.unselectOption(a);return}}else if(c){if(this.activeOption!==-1){if(this.previousShift!==undefined){this.activeOption=this.previousShift;this._removePreviousSelection()}else this.previousShift=
554 this.activeOption;b=this.activeOption>a?this.activeOption:a;for(a=this.activeOption<a?this.activeOption:a;a<=b;a++)this.element.find("option").eq(a).prop("selected")||this.selectOption(a);return}}else this._removePreviousSelection()}else this._removePreviousSelection();this.previousShift=undefined;this.selectOption(a)},selectOption:function(a){this.activeOption=a;this.selectedOptions.push(a);this.selectItems.find("a").eq(a).focus().addClass("ui-ncbiselect-item-active").attr("tab-index","");this._selectOptionInOrginalElement(this.activeOption)},
555 _focusOption:function(a){this.selectItems.find("a").eq(a).focus()},_selectOptionInOrginalElement:function(a,b){this.element.find("option").eq(a).prop("selected",true);b||this.element.change()},_removeOptionInOrginalElement:function(a,b){this.element.find("option").eq(a).prop("selected",false);b&&this.element.change()},_removePreviousSelection:function(){var a;if(this.activeOption!==null&&this.selectedOptions.length>0){for(a=0;a<this.selectedOptions.length;a++)this.unselectOption(this.selectedOptions[a],
556 true);this.selectedOptions=[]}},unselectOption:function(a){this.selectItems.find("a").eq(a).removeClass("ui-ncbiselect-item-active").attr("tab-index",-1);this._removeOptionInOrginalElement(a)},value:function(a){if(a===undefined)return this.element.val();else{this.element.val(a);this._removePreviousSelection();this.selectOption(this.element.prop("selectedIndex"))}},_scrollSelectionIntoView:function(){var a=this.element.prop("selectedIndex");if(a!==-1){var b=this._ul,c=b.offset().top,d=b.height(),f=
557 this.selectItems.eq(a).height();a=this.selectItems.eq(a).offset().top-c+f;d<a&&b.prop("scrollTop",a-d)}},getAllSelectedIndexes:function(){var a=[];this.element.find("option:selected").each(function(b){a.push(b)});return a},getGeneratedElem:function(){return this._ul}});
558 jQuery.widget("ui.ncbiinpagenav",{options:{currentHeadingClass:"currentHeading",gotoLinkText:"Go to:",gotoLinkTitle:"Go to other sections in this page",gotoTopLink:false,gotoTopLinkAttrs:{},gotoTopLinkHref:"#top",gotoTopLinkText:"Top&#9650;",headingLevel:null,allHeadingLevels:["h2","h3","h4","h5","h6"],headingExclude:".jig-ncbiinpagenav-heading-exclude",inHeadingExclude:".jig-ncbiinpagenav-inheading-exclude, .ui-helper-hidden-accessible",smoothScroll:true,gotoPoppers:true,topOfPageTOC:false,tocTagName:"ul",
559 addNumbers:false,puncMark:"."},_create:function(){this._inPageNav();this._scrollIntoView()},destroy:function(){this._removeGoto();this._removeScrollListener();this._removeTOC();this.options.addNumbers&&this.element.find(".jig-ncbiinpagenav-number").remove()},_makeGotoDiv:function(a,b){var c='<div class="goto jig-ncbiinpagenav-goto-container">';if(this.options.gotoPoppers){c+='<a class="tgt_dark page-toc-label jig-ncbiinpagenav-goto-heading" href="#"';c+=' title="'+this.options.gotoLinkTitle+'">'+
560 this.options.gotoLinkText+"</a>"}if(this.options.gotoTopLink){c+='<ul class="links inline_list_right">';c+="<li"+b+'><a href="'+this.options.gotoTopLinkHref+'"';for(var d in this.options.gotoTopLinkAttrs)c+=" "+d+'="'+this.options.gotoTopLinkAttrs[d]+'"';c+=">"+this.options.gotoTopLinkText+"</a></li></ul>"}c+="</div>";a.not(this.options.headingExclude).addClass("ui-helper-clearfix").before(c)},_makeTopOfPageTOC:function(a,b,c){a=this._buildLis(a,this.options.tocTagName,true);b=this.options.smoothScroll?
561 " jig-ncbismoothscroll":"";var d=this.options.smoothScroll?" data-jigconfig=\"topHref: '"+this.options.gotoTopLinkHref+"'\"":"",f=this.options.tocTagName;jQuery("<"+f+' id="'+this.getTocId()+'" class="jig-ncbiinpagenav-toc-container'+b+'"'+d+">"+a+"</"+f+">").prependTo(c)},_makeGotoPoppers:function(a,b,c,d){b=this.getPopMenuId();a=this._buildLis(a,"ul",false);c=jQuery('<ul id="'+b+'"'+d+">"+a+"</ul>").appendTo(c);a=this.element.find(".jig-ncbiinpagenav-goto-heading");d=a.eq(0);a=a.filter(":gt(0)");
562 var f=this;d.ncbilinksmenu({destSelector:"#"+b,multipleHandlesSelector:a,openAtTarget:true,triggerPosition:"bottom left"}).bind("ncbilinksmenuopen",function(){f._inPageNavMenuOpen()}).bind("ncbilinksmenuclose",function(){f._inPageNavMenuClose()});this._firstAnchor=d;typeof ncbi!=="undefined"&&ncbi.sg&&ncbi.sg.scanLinks(c[0].getElementsByTagName("a"))},_buildLis:function(a,b,c){var d=jQuery.map(this.options.allHeadingLevels,function(s){return s.toLowerCase()}),f=this.options.headingLevel?this.options.headingLevel.toLowerCase():
563 d[0],g=this.options.headingExclude,i=d.indexOf(f),e="",h=this.options.addNumbers;if(h)var j=[1];for(var k=0;k<a.length;k++){var l=a[k],n=jQuery(l);l=l.nodeName.toLowerCase();if(!(!c&&l!=f))if(!(g!=null&&n.is(g))){l=d.indexOf(l);if(l>i&&k>0)for(;i<l;){e+="<"+b+"><li>";i+=1;h&&j.push(1)}else if(l==i&&k>0){e+="</li><li>";if(h)j[j.length-1]+=1}else if(l<i&&k>0){for(;i>l;){e+="</li></"+b+">";i-=1;h&&j.pop()}if(h)j[j.length-1]+=1;e+="</li><li>"}else e+=k==0?"<li>":"</li><li>";e+='<a href="#';n.prop("id")===
564 ""&&n.prop("id",jQuery.ui.jig._generateId("ncbiinpagenav-heading"));e+=n.prop("id");e+='">'+n.clone().find(this.options.inHeadingExclude).remove().end().text()+"</a>";if(this.options.addNumbers&&!n.is(this.options.headingExclude)){i=jQuery.map(j,function(s){return""+s}).join(".");puncMark=this.options.puncMark;n.html('<span class="jig-ncbiinpagenav-number">'+i+"</span>"+puncMark+" "+n.html())}i=l;if(k==a.length-1){for(;i>0;){e+="</li></"+b+">";i-=1}e+="</li>"}}}return e},_inPageNav:function(){var a=
565 this.options.allHeadingLevels,b=this.options.headingLevel?this.options.headingLevel.toLowerCase():a[0];b=a.indexOf(b);a=this.element.find(a.slice(b).join(", "));b=this.element;var c=b.length?b:jQuery(document.body),d=this.options.smoothScroll?' class="jig-ncbismoothscroll" data-jigconfig="topHref: \''+this.options.gotoTopLinkHref+"'\"":"";if(this.options.gotoTopLink||this.options.gotoPoppers)this._makeGotoDiv(a,d);this.options.gotoPoppers&&this._makeGotoPoppers(a,b,c,d);this.options.topOfPageTOC&&
566 this._makeTopOfPageTOC(a,b,c)},getTocId:function(){typeof this.element.data("tocId")=="undefined"&&this.element.data("tocId",jQuery.ui.jig._generateId(this.widgetName));return this.element.data("tocId")},getPopMenuId:function(){typeof this.element.data("popMenuId")=="undefined"&&this.element.data("popMenuId",jQuery.ui.jig._generateId(this.widgetName));return this.element.data("popMenuId")},_removeGoto:function(){jQuery(".jig-ncbiinpagenav-goto-container").add("#"+this.getPopMenuId()).remove()},_removeTOC:function(){jQuery("jig-ncbiinpagenav-toc-container").add("#"+
567 this.getTocId()).remove()},_inPageNavMenuResetCurrent:function(){var a=jQuery(this._firstAnchor).ncbilinksmenu("getDestElement");a=jQuery(a.data("attached-to")).parents(".jig-ncbiinpagenav");jQuery("#"+a.data("ncbiinpagenav").getPopMenuId()).find("a").show().end().find("."+a.ncbiinpagenav("option","currentHeadingClass")).remove()},_inPageNavMenuOpen:function(){var a=jQuery(this._firstAnchor).ncbilinksmenu("getDestElement"),b=jQuery(a.data("attached-to"));a=b.parents(".jig-ncbiinpagenav");b=b.parents(".jig-ncbiinpagenav-goto-container").next().text();
568 var c=a.data("ncbiinpagenav").getPopMenuId();b=jQuery("#"+c).find('a:contains("'+b+'")');a=a.ncbiinpagenav("option","currentHeadingClass");this._inPageNavMenuResetCurrent();a=jQuery("<span/>").addClass(a).text(b.text());b.hide().before(a);this._addScrollListener()},_inPageNavMenuClose:function(){this._removeScrollListener();this._inPageNavMenuResetCurrent()},_scrollIntoView:function(){var a=0,b=null,c=window.location.hash.replace(".","\\.");if(c){var d=function(){var g=f.position().top;if(b!=g){window.scrollTo(0,
569 g);b=g}else{a++;a<this.element.find(this.options.allHeadingLevels.join(", ")).length&&window.setInterval(d,1)}},f=jQuery(c);f.length&&d()}},_addScrollListener:function(){var a=this;this._scrollYStart=jQuery(window).scrollTop();this._windowScrollFnc=function(){Math.abs(a._scrollYStart-jQuery(window).scrollTop())>200&&a._firstAnchor.ncbilinksmenu("close")};jQuery(window).on("scroll",this._windowScrollFnc)},_removeScrollListener:function(){jQuery(window).off("scroll",this._windowScrollFnc);this._windowScrollFnc=
570 null}});
571 jQuery.widget("ui.ncbispinbox",{options:{},_wrapper:null,_create:function(){if(this.element.attr("type")!="number")return false;this._convert()},destroy:function(){this._revert()},_convert:function(){if(!this._numberSupported()){var a=this;this.element.addClass("ui-ncbispinbox");this._wrapper=jQuery('<span class="ui-ncbispinbox-arrows"></span>').insertAfter(this.element);this.element.on("keydown.ncbi-spinbox-change",function(b){switch(b.keyCode){case 38:a.stepUp();break;case 40:a.stepDown();break;
572 default:return true}return false});this.element.on("blur.ncbi-spinbox-valid",function(){a._validate()});jQuery('<input type="button" class="ui-ncbispinbox-up" />').appendTo(this._wrapper).click(function(){a.stepUp()});jQuery('<input type="button" class="ui-ncbispinbox-down" />').appendTo(this._wrapper).click(function(){a.stepDown()})}},_revert:function(){if(!this._numberSupported()){this._wrapper.remove();this.element.off(".ncbi-spinbox-valid");this.element.off(".ncbi-spinbox-change")}},_numberSupported:function(){var a=
573 document.createElement("input");a.setAttribute("type","number");return a.type!=="text"},_stepValue:function(a){return typeof a!="undefined"&&a!=null?parseFloat(a):this.element.attr("step")?parseFloat(this.element.attr("step")):1},_validate:function(a){a=typeof a!="undefined"?a:parseFloat(this.element.val());if(isNaN(a)){this.element.val("");return false}var b=parseFloat(this.element.attr("min"));if(isNaN(b))b=0;else if(a<b){this.element.val(b);return false}var c=parseFloat(this.element.attr("max"));
574 if(!isNaN(c)&&a>c){this.element.val(c);return false}c=parseFloat(this.element.attr("step"));if(isNaN(c))c=1;var d=(a-b)%parseFloat(c);if(d>0){a=(Math.round(d/c)+Math.floor((a-b)/c))*c+b;this.element.val(a);return false}this.element.val(a);return true},stepUp:function(a){this._validate(this.valueAsNumber()+this._stepValue(a))},stepDown:function(a){this._validate(this.valueAsNumber()-this._stepValue(a))},valueAsNumber:function(){this._validate();var a=this.element.val();if(a=="")a=0;return parseFloat(a)}});
575 jQuery.widget("ui.ncbiformvalidator",{options:{tags:"input, select",updateTitle:true},_create:function(){this._supportsHTML5Validation()||this._addValidator()},destroy:function(){_removeEvents()},_supportsHTML5Validation:function(){return typeof document.createElement("input").checkValidity=="function"},_addValidator:function(){var a=this;this.element.on("submit.ncbi-formvalidator",function(){var b=true;a.element.find(a.options.tags).each(function(){var c=jQuery(this),d=a._isInvalidField(c.attr("required"),
576 c.attr("type"),c.val(),c.attr("pattern"));a.options.updateTitle&&c.attr("title",d);d&&c.addClass("ui-ncbiformvalidator-error");if(d&&b){c.focus();c.ncbipopper({destText:d,openEvent:"none",closeEvent:"none",triggerPosition:"bottom center",destPosition:"top center",hasArrow:true,adjustFit:"autoAdjust",arrowDirection:"top",openAnimation:"none",closeAnimation:"none"});c.ncbipopper("open");jQuery(window).one("click",function(){c.ncbipopper("close")});b=false}});return b});this.element.find(this.options.tags).on("blur.ncbi-formvalidator",
577 function(){var b=jQuery(this);b.val();b.attr("type");var c=a._isInvalidField(b.attr("required"),b.attr("type"),b.val(),b.attr("pattern"));if(c){b.addClass("ui-ncbiformvalidator-error");a.options.updateTitle&&b.attr("title",c)}else{b.removeClass("ui-ncbiformvalidator-error");a.options.updateTitle&&b.attr("title","")}})},_isInvalidField:function(a,b,c,d){if(c!=null){if(c.length===0)if(!a||b=="submit"||b=="button"||b=="image")return null;else if(a)return"Please fill out this field";if(b=="email"&&!this._validatePattern(/((([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-zA-Z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?/,
578 c))return"Please enter an e-mail address";if(b=="phone"&&!this._validatePattern(/([\+][0-9]{1,3}([ \.\-])?)?([\(]{1}[0-9]{3}[\)])?([0-9A-Z \.\-]{1,32})((x|ext|extension)?[0-9]{1,4}?)/,c))return"Please enter a phone number";if(b=="url"&&!this._validatePattern(/(https?|ftp):\/\/(((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-zA-Z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-zA-Z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?/,
579 c))return"Please enter a URL";if(b=="number"&&!this._validatePattern(/-?(?:\d+|\d{1,3}(?:,\d{3})+)(?:\.\d+)?/,c))return"Please enter a number";if(d&&!this._validatePattern(new RegExp(d),c))return"Invalid value";return null}},_validatePattern:function(a,b){if(!a)return true;return a.test(b)},_removeEvents:function(){this.element.off(".ncbi-formvalidator");this.element.find(this.options.tags).off(".ncbi-formvalidator")}});
580 (function(){jQuery.widget("ui.ncbihelppopper",{options:{fullHelpUrl:null,isInline:false,destSelector:"",destText:null},_create:function(){this._createAndAppendLink();this._setPopperOptions();this._callAndModifyPopper()},_bulletHtml:'<span class="ui-ncbihelppopper-bullet">&bull;</span>',_helpLinkHtml:'<a href="#" class="ui-ncbihelppopper-helplink">Help</a>',_createAndAppendLink:function(){this.bulletSpan=jQuery(this._bulletHtml);this.helpLink=jQuery(this._helpLinkHtml);this.options.destSelector&&this.helpLink.attr("href",
581 this.options.destSelector);this.element.append(this.bulletSpan);this.element.append(this.helpLink)},_setPopperOptions:function(){var a=this.options;a.hasArrow=true;a.openEvent="click";a.closeEvent="click";a.openAnimation="none";a.closeAnimation="none";a.addCloseButton=true;a.cssClass="ui-ncbihelppopper";a.wrapElement=true;a.openAtTarget=true;if(a.isInline==true&&!a.destText){a.destPosition="top center";a.triggerPosition="bottom center";a.arrowDirection="top";if(!a.width)a.width="auto"}else{a.destPosition=
582 "center left";a.triggerPosition="center right";a.arrowDirection="left";if(!a.width)a.width="200px"}},_callAndModifyPopper:function(){var a=this.element.find("a.ui-ncbihelppopper-helplink");this.popper=a;var b=this.options;a.ncbipopper(b);a=a.ncbipopper("getDestElement");b.isInline==true&&!b.destText?a.addClass("ui-ncbihelppopper-inline"):a.addClass("shadow");a=a.find("div").first();a.addClass("ui-ncbihelppopper-inner");a=a.find(">:last-child");b.fullHelpLink?a.addClass("ui-ncbihelppopper-last"):a.css("margin-bottom",
583 "0");this._appendFullHelpLinkToPopper()},_appendFullHelpLinkToPopper:function(){if(this.options.fullHelpLink){var a="<div class='ui-ncbihelppopper-fullHelp'><a href="+this.options.fullHelpLink+">More...</a></div>";this.popper.ncbipopper("getDestElement",true).append(a)}}})})();
584 jQuery.widget("ui.ncbihelpwindow",{options:{status:false,toolbar:false,location:false,menubar:false,personalbar:false,resizable:true,scrollbars:true,height:700,width:600,windowName:null},_init:function(){},_create:function(){this._addClickEvent()},_addClickEvent:function(){var a=this;this.element.click(function(b){if(a._openWindow())return true;else{b.preventDefault();return false}})},_openWindow:function(){var a=this.options,b=this.element.prop("href"),c=jQuery(window).width(),d=jQuery(window).height();
585 d=Math.floor((d-a.height)/2);c=Math.floor((c-a.width)/2);c="status="+(a.status?"yes":"no")+", toolbar="+(a.toolbar?"yes":"no")+", location="+(a.location?"yes":"no")+", menubar="+(a.menubar?"yes":"no")+", personalbar="+(a.personalbar?"yes":"no")+", resizable="+(a.resizable?"yes":"no")+", scrollbars="+(a.scrollbars?"yes":"no")+", height="+a.height+", width="+a.width+", top="+d+", left="+c+",screenX="+d+",screenY="+c;a=a.windowName||this.element.attr("target")||"_blank";a=a.replace(/\s/,"_");this.winPop&&
586 !this.winPop.closed&&this.winPop.focus();this.winPop=b=window.open(b,a,c);b=b===null||typeof b==="undefined";this._callStat(b);this._trigger("opened");return b},_callStat:function(a){typeof ncbi!=="undefined"&&ncbi.sg&&ncbi.sg.ping&&ncbi.sg.ping(this.element[0],"ncbihelpwindow","isBlocked="+a)}});
587 jQuery.widget("ui.ncbiautofocus",{_create:function(){var a,b;if(jQuery.ui.ncbiautofocus.registeredElement){a="More than one element is registered for ncbiautofocus\n\tAlready Registered: \t"+this._outerHTML(jQuery.ui.ncbiautofocus.registeredElement)+"\n\tTrying to Register: \t\t"+this._outerHTML(this.element);if(typeof console!=="undefined"){b=console.error?"error":"log";console[b](a)}else throw a;}else{jQuery.ui.ncbiautofocus.registeredElement=this.element;this._addKeyDownEvent()}},_outerHTML:function(a){return jQuery("<div>").append(a.clone()).html()},
588 destroy:function(){this._removeKeyDownEvent()},_addKeyDownEvent:function(){var a=this.element,b=a[0];this._documentKeydown=function(c){var d=c.srcElement||c.target,f=c.keyCode||c.which,g=a.val().length;if(!(c.ctrlKey||c.altKey||c.metaKey)&&(f>=48&&f<=90||f>=96&&f<=111)&&jQuery(d).not(":input,a").length===1)if(b.createTextRange){c=b.createTextRange();c.moveStart("character",g);c.collapse();c.select()}else if(b.setSelectionRange){a.focus();b.setSelectionRange(g,g)}else a.focus()};jQuery(document).on("keydown",
589 this._documentKeydown)},_removeKeyDownEvent:function(){this._documentKeydown&&jQuery(document).off("keydown",this._documentKeydown)}});jQuery.ui.ncbiautofocus.registeredElement=null;
590 (function(){jQuery.widget("ui.ncbisetswitch",{options:{webservice:null,destSelector:null,localJSON:null,manageCollectionsUrl:null,createCollectionUrl:null,defaultActive:false},_create:function(){this._wrapElem();this._createStar();this._createArrow();this._attachLinksMenu();this._createActionListItem();this._positionActionListItem();this._attachLinkEvent();this._addToggleStarClick()},_wrapElem:function(){this.wrapper=this.element.wrap("<div class='ui-ncbisetswitch'></div>").parent()},_unwrapElem:function(){this.element.unwrap()},
591 _createStar:function(){this.element.prepend("<span class='star'></span>");this.element.addClass("ui-ncbisetswitch-hasStar");this.options.defaultActive===true&&this.element.find(".star").addClass("active")},_destroyStar:function(){this.element.find(".star").remove();this.element.removeClass("ui-ncbisetswitch-hasStar")},_createArrow:function(){this.downButton=jQuery("<a class='ui-ncbisetswitch-button' title='View more options' href='#'><span class='ui-icon ui-icon-triangle-1-s ui-ncbisetswitch-down'>View more options</span></a>").insertAfter(this.element);
592 this.downButton.prev().hasClass("ltd-hover")&&this.downButton.addClass("ltd-hover")},_destroyArrow:function(){this.downButton.remove()},_attachLinksMenu:function(){this.wrapper.ncbilinksmenu({webservice:this.options.webservice,openAnimationTime:150,destSelector:this.options.destSelector,localJSON:this.options.localJSON,triggerPosition:"bottom left",wrapElement:true,ignoreDefaultTrigger:true,closeOnSelect:false});var a=this.wrapper.ncbilinksmenu("getDestElement");a.addClass("ui-ncbisetswitch-popper");
593 a.find(">ul:first-child").addClass("ui-ncbisetswitch-options")},_destroyLinksMenu:function(){var a=this.wrapper.ncbilinksmenu("getDestElement");a.removeClass("ui-ncbisetswitch-popper");a.find(">ul:first-child").removeClass("ui-ncbisetswitch-options");this.wrapper.ncbilinksmenu("destroy")},_hideList:function(){this.options.destSelector&&jQuery(this.options.destSelector).hide()},_hideAccessible:function(){var a=this.element.prev("a.ui-helper-hidden-accessible");a.prev("p.ui-helper-hidden-accessible").remove();
594 a.remove()},destroy:function(){this._destroyLinksMenu();this._unwrapElem();this._destroyStar();this._destroyArrow();this._destroyActionListItem();this._detachLinkEvent();this._removeToggleStarClick();this._hideList();this._hideAccessible()},_createActionListItem:function(){jQuery.ui.ncbisetswitch._globalActionsList={};var a=this.wrapper.ncbilinksmenu("getDestElement").children(":first");a={actionList:jQuery("<ul class='ui-ncbisetswitch-actions'></ul>").appendTo(a.parent())};a.createCollection=jQuery("<li class='ui-ncbisetswitch-actions-create'><a class='ui-ncbisetswitch-create-collection'>Create collection...</a></li>").appendTo(a.actionList);
595 a.managecollections=jQuery("<li class='ui-ncbisetswitch-actions-manage'><a class='ui-ncbisetswitch-manage-collections'>Manage collections...</a></li>").appendTo(a.actionList);this._gol=a},_destroyActionListItem:function(){this._gol.actionList.remove()},_positionActionListItem:function(){if(this._gol.activeElement!==this.element){var a=this.options.manageCollectionsUrl!==null?"block":"none",b=this.options.createCollectionUrl!==null?"block":"none",c=a==="block"||b==="block"?"block":"none";jQuery(this._gol.createCollection).css("display",
596 b).children("a:first").attr("href",this.options.createCollectionUrl);jQuery(this._gol.managecollections).css("display",a).children("a:first").attr("href",this.options.manageCollectionsUrl);jQuery(this._gol.actionsItem).css("display",c)}else this._gol.activeElement=this.element},_addToggleStarClick:function(){var a=this;this._makingMainSelectionClickFunc=function(){a._makingMainSelection()};this.element.on("mousedown keydown",this._makingMainSelectionClickFunc);this._downButtonKeydownFunc=function(b){(b||
597 window.event).keyCode===40&&a.downButton.mousedown().click()};this._downButtonMousedownFunc=function(b){a._arrowClickedSelection(b,this)};this.downButton.keydown(this._keydownFunc).on("mousedown",this._mousedownFunc);this._toggleStarSubClickFunc=function(b){a._toggleStarSub(b,b.target)};this._setswitchOptionsMousedownFunc=function(){var b=jQuery(this);a._makingSubSelection(b,b.parent())};this.wrapper.ncbilinksmenu("getDestElement").find(".ui-ncbisetswitch-options a").on("mousedown keydown",this._setswitchOptionsMousedownFunc);
598 typeof ncbi!=="undefined"&&ncbi.sg&&ncbi.sg.scanLinks([this.downButton[0],this.element[0]])},_removeToggleStarClick:function(){this.element.unbind("mousedown",this._makingMainSelectionClickFunc).unbind("keydown",this._makingMainSelectionClickFunc);this.downButton.unbind("keydown",this._keydownFunc).unbind("mousedown",this._mousedownFunc);this.wrapper.find(".ui-ncbisetswitch-options a").unbind("mousedown",this._setswitchOptionsMousedownFunc).unbind("keydown",this._setswitchOptionsMousedownFunc)},_arrowClickedSelection:function(a,
599 b){a=this.wrapper.ncbilinksmenu("getDestElement").is(":visible")?"closed":"opened";jQuery(b).prop("ref","jigwidget=ncbisetswitch&item=downarrowclicked&action="+a)},_makingMainSelection:function(){this.element.prop("ref","jigwidget=ncbisetswitch&item=mainlink&action="+(this.element.find("span.star").hasClass("active")?"unselected":"selected"))},_makingSubSelection:function(a,b){b=b.hasClass("starred")?"unselected":"selected";a.prop("ref","jigwidget=ncbisetswitch&item=sublink&action="+b)},_attachLinkEvent:function(){this._linkEventFunc=
600 function(a){a.preventDefault();a.stopPropagation()};this.element.click(this._linkEventFunc)},_detachLinkEvent:function(){this.element.unbind("click",this._linkEventFunc)}})})();
601 jQuery.widget("ui.ncbihistogram",{options:{data:null,barWidth:5,barSpacing:1,useLogScale:false,selected:null,sortData:true,isNumeric:true,convertYYYYMMtoYYYY:true,textDefault:"",textSelected:"Selected",textTooltip:" {label} - {count} items",destSelector:null,enableZeroCountSelection:false},_create:function(){this._addClasses();this._setUpData();this._createTooltip();this._setupPositionScroll();this._addEvents();this._setBarWidths()},_addClasses:function(){this.element.addClass("ui-ncbihistogram")},
602 _formatDataFromHTMLSource:function(a){var b=jQuery(a),c=b.find("li");if(c.length===0){console.warn("Could not locate any lis for the ncbihistogram. destSelector: "+a);return[]}var d={},f=this.options.convertYYYYMMtoYYYY;c.each(function(){var i=this.getAttribute("value");i=f&&i!==null&&i.toString().length>4?i.toString().substr(0,4):i;var e=d[i],h=parseInt(this.innerHTML,10);if(e===undefined)d[i]=h;else d[i]+=h});a=[];for(var g in d)a.push({textlabel:parseInt(g,10),count:d[g]});b.remove();return a},
603 _makeLists:function(){var a=this.options.data,b=this.options.destSelector;if(b)a=this._formatDataFromHTMLSource(b);if(a.length===0)if(typeof console!=="undefined"){console.warn("There is no data set for ncbihistogram. Length is zero.");console.info(this.element);this.element.hide();return false}var c=function(m){m+="";var p=m.split(".");m=p[0];p=p.length>1?"."+p[1]:"";for(var u=/(\d+)(\d{3})/;u.test(m);)m=m.replace(u,"$1,$2");return m+p},d=this.element.find(".ui-ncbihistogram-display-area").height(),
604 f=this.options.useLogScale,g=this.options.selected,i=this.options.isNumeric,e=0,h=this.options.textTooltip,j=null;j=this.options.sortData?jQuery.merge([],a).sort(function(m,p){return m.textlabel===p.textlabel?0:m.textlabel>p.textlabel?1:-1}):a;var k=false,l=function(m,p,u){if(m===null)m=p-1;for(m=m+1;m<=p;m++){if(m%10===0||!k)n(Math.floor(m/10)*10);r(m,m===p?u:0)}},n=function(m){k&&s();v.push("<li><h3>"+m+"</h3><ol>");k=true},s=function(){v.push("</ol></li>")},r=function(m,p){e++;var u=null;u=f?p===
605 0?0:Math.ceil(d*Math.log(p)/Math.log(o)):Math.ceil(d*p/o);if(p>0&&u<3)u=3;var x=d-u;p=c(p.toString());var w=' title="'+h.replace(/\{label\}/gi,m).replace(/\{count\}/gi,p)+'"';v.push('<li><a href="#"'+w+(' style="height:'+u+"px;margin-top:"+x+'px"')+(' data-label="'+m+'"')+(' data-count="'+p+'"')+(g===m?' class="selected"':"")+">Year "+m+" - "+p+" items</a></li>")},v=[],o=j[0].count;jQuery.map(j,function(m){if(o<m.count)o=m.count});var q=null;jQuery.map(j,function(m,p){p=j[p];m=p.textlabel;p=p.count;
606 if(i){l(q,m,p);q=m}else r(m,p)});a=' class="not-nested"';if(i){s();a=""}return'<ol style="width:'+e*(this.options.barWidth+this.options.barSpacing)+'px" '+a+">"+v.join("")+"</ol>"},_makeArrows:function(){var a=this;this._controlBar=jQuery('<div class="ui-ncbihistogram-controls"></div>');this._arrow_right=jQuery("<div></div>").addClass("ui-ncbihistogram-right").html("Scroll right...").appendTo(this._controlBar).click(function(){a.moveRight()});this._arrow_left=jQuery("<div></div>").addClass("ui-ncbihistogram-left").html("Scroll left...").appendTo(this._controlBar).click(function(){a.moveLeft()});
607 this._text_hint=jQuery("<div></div>").addClass("ui-ncbihistogram-text").html(this.options.textDefault).appendTo(this._controlBar);this._controlBar.appendTo(this.element);this._setText()},_createElements:function(){jQuery('<div class="ui-ncbihistogram-display-area"></div>').appendTo(this.element).html(this._makeLists());this._makeArrows()},_setUpData:function(){if(this.options.data||this.options.destSelector)this._createElements();else if(typeof console!=="undefined"&&console.error){console.error("No data source set for ncbihistogram");
608 console.info(this.element)}},_setupPositionScroll:function(){if(jQuery.ui.jig.hasOnloadFired)this._positionScroll();else{var a=this;jQuery(window).load(function(){a._positionScroll()})}},_positionScroll:function(){var a=this.element.find(".ui-ncbihistogram-display-area"),b=this.element.find("ol").eq(0);b=b.width()>a.width()?b.outerWidth():0;var c=this._getSelectedYear();if(c.length===1){b=a.offset().left;var d=c.offset().left;a.prop("scrollLeft");c=a.width();b=d-b;b=b<0?-b+c/2:b-c/2}a.scrollLeft(b);
609 this._enableDisableArrows(a.scrollLeft())},moveLeft:function(){this.moveScroll(-1)},moveRight:function(){this.moveScroll(1)},moveScroll:function(a){var b=this.element.find(".ui-ncbihistogram-display-area"),c=b.width(),d=this.element.find("ol").width(),f=Math.ceil(d/3);if(c>=d)return false;if(f<100)f=100;else if(f>c)f=c;d=b.scrollLeft()+a*f;if(d<0)d=0;if(typeof ncbi!=="undefined"&&ncbi.sg)ncbi.sg.ping({jsevent:"histogramScroll",direction:a===1?"right":"left",startPosition:b.scrollLeft(),endPosition:d,
610 scrollDist:f,wrapWidth:c});b.animate({scrollLeft:d+"px"},300);this._enableDisableArrows(d)},_enableDisableArrows:function(a){var b=this.element.find(".ui-ncbihistogram-display-area").width(),c=this.element.find("ol").eq(0).width();b=a+b>=c-1?"addClass":"removeClass";this._arrow_left[a===0?"addClass":"removeClass"]("ui-ncbihistogram-left-disabled");this._arrow_right[b]("ui-ncbihistogram-right-disabled")},_addEvents:function(){var a=this;this.element.on("mouseleave",function(){a._hideTooltips()}).on("mouseover",
611 function(b){a._positionTooltip(b)}).find(this.options.isNumeric?"ol ol li":"li").on("click",function(b){a._makeSelection(b,this)})},_makeSelection:function(a,b){var c=jQuery(b).find("a");a.preventDefault();var d,f=c.data("label")||c.attr("data-label"),g=c.data("count")||c.attr("data-count");if(parseInt(g,10)===0)this._zeroNotify(f);else{c.toggleClass("selected");d=c.hasClass("selected")?"selectionmade":"selectionremoved";f=c.data("label")||c.attr("data-label");g=c.data("count")||c.attr("data-count");
612 b&&b.tagName==="LI"&&typeof ncbi!=="undefined"&&ncbi.sg&&ncbi.sg.ping(c[0],a,"click",{histogramclick:true,barLabel:f,barCount:g,triggerAction:d});this._trigger(d,null,[{value:f,count:g}]);this._trigger("change",null,[{value:d==="selectionmade"?f:null,count:d==="selectionmade"?g:null}]);this._undoSelections(c[0]);this._setText()}},_undoSelections:function(a){this._getSelectedYear().not(a).removeClass("selected")},_getSelectedYear:function(){return this.element.find("a.selected")},getSelectedValue:function(){var a=
613 this._getSelectedYear();if(a.length===0)return null;else{var b=a.data("label")||a.attr("data-label");a=a.data("count")||a.attr("data-count");return{value:b,count:a}}},setSelectedValue:function(a){var b=false;this.element.find("li a").each(function(){var c=jQuery(this);if(c.data("label")==a){b=true;c.click();return false}});if(b){this.element.find(".ui-ncbihistogram-display-area").scrollLeft(0);this._positionScroll()}},_setText:function(a){var b=this._getSelectedYear(),c=this.options.textDefault;if(a)c=
614 a;else if(b.length>0)c=this.options.textSelected+" "+b.prop("title");this._text_hint.html(c)},_setBarWidths:function(){var a=this.element.find(".ui-ncbihistogram-display-area"),b=this.element.find("div>ol"),c=a.width();if(c>b.width()){var d=b.find("a");a=Math.floor(a.width()/d.length*2)/2;d.css({width:a-1+"px","margin-right":"1px"}).last().css("margin-right","0px");d=Math.ceil(c-a*d.length-1)/2;b.width(c-1).css("padding-left",d+"px")}},_createTooltip:function(){var a=jQuery(".grid").eq(0);if(a.length===
615 0)a=jQuery(document.body);this._tooltip_total=jQuery('<div class="ui-ncbihistogram-tooltip"></div>').appendTo(a)},_positionTooltip:function(a){a=jQuery(a.target||a.srcElement);a=a.length===1&&a[0].nodeName==="LI"?a.find("a"):a;if(a.length===1&&this._tooltip_total){var b=a.data("count"),c=a.data("label");if(c===undefined)this._tooltip_total.hide();else try{this._tooltip_total.show().html(c+": "+b).position({my:"right top",of:a.parent(),at:"left top",collision:"fit"})}catch(d){this._tooltip_total.hide()}}},
616 _hideTooltips:function(){this._tooltip_total.hide().html("")},_zeroNotify:function(a){var b=this;this._setText("No items found for "+a.toString());this._text_hint.stop().delay(1E3).fadeOut(300,function(){b._setText()}).fadeIn(300)}});
617 jQuery.widget("ui.ncbiexternallink",{options:{pop:"fit"},_otherElems:null,_create:function(){this._createMessage();this._setPopper();this._addDynamicLinkHandler()},_reALL:/^(.{3,5}:)?\/\/(([^/]+).)?(apple|facebook|google|twitter|youtube)\.com/i,_addDynamicLinkHandler:function(){var a=this;jQuery("body").on("mouseover","a[href]",function(b){b=jQuery(b.currentTarget);if(a._reALL.test(b[0].href)&&!b.is(a._otherElems))if(!b.data("ncbipopper")){a._createPopper(b,"",a._popperContent);a._setTarget(b);b.trigger("mouseover")}})},
618 _findLinks:function(a){var b=this._reALL;return a.find("a[href]").filter(function(){return b.test(this.href)})},_disclaimerHTML:'<div style="display: none;">External link. Please review our <a href="http://www.nlm.nih.gov/privacy.html">privacy policy</a>.</div>',_createMessage:function(){var a=jQuery("div.grid").eq(0);if(a.length===0)a=jQuery(document.body).eq(0);this._popperContent=jQuery(this._disclaimerHTML).appendTo(a)},_setTarget:function(a){a.each(function(){if(!this.target)this.target="_blank"})},
619 _createPopper:function(a,b,c){var d="top",f="bottom center",g="top center";if(this.options.pop==="top"){d="bottom";f="top center";g="bottom center"}else if(this.options.pop==="fit"){d="left";g=f="middle auto"}else if(this.options.pop==="fitTop"){d="left";g=f="auto center"}a.ncbipopper({multipleHandlesSelector:b,openAtTarget:true,destSelector:c,isDestElementCloseClick:false,openAnimation:"none",closeAnimation:"none",isTriggerElementCloseClick:false,triggerPosition:f,destPosition:g,hasArrow:true,arrowDirection:d})},
620 _setPopper:function(){var a=this._findLinks(jQuery("body")),b=this._firstElem=a.eq(0),c=a.slice(1);this._otherElems=c;this._createPopper(b,c,this._popperContent);this._setTarget(a);if(typeof ncbi!=="undefined"&&ncbi.sg&&ncbi.sg.scanLinks){a=this._popperContent.find("a")[0];ncbi.sg.scanLinks(a)}},destroy:function(){this._firstElem.ncbipopper("destroy");this._popperContent.remove()}});
621 jQuery.widget("ui.ncbiactivevalidation",{options:{destElement:null,delay:400,validationFunction:null,validatingMsg:null},_create:function(){this._addEvents();this._addClasses();this.element.val().length>0&&this.runCheck(true)},runCheck:function(a){this._removeTimer();if(this.element.val().length===0)this.displayMessage(null,"");else if(this.lastValue!==this.element.val()){var b=this.options.validatingMsg;b?this.displayMessage("checking",b):this.displayMessage(null,"");a?this._callValidation():this._setTimer()}},
622 _removeTimer:function(){this._validationTimer&&window.clearTimeout(this._validationTimer)},_setTimer:function(){var a=this;this._validationTimer=window.setTimeout(function(){a._callValidation()},this.options.delay)},_callValidation:function(){this.lastValue=this.element.val();if(this.lastValue.length===0)this.displayMessage(null,"");else{var a=this.options.validationFunction;if(a){if(typeof a==="string"){a=jQuery.ui.jig._getFncFromStr(a);var b=this;if(!a){this.count=a=(this.count||0)+1;if(a>100){console.warn("Validation Function not find "+
623 this.options.validationFunction);a=function(){this.displayMessage(null,"")}}else{window.setTimeout(function(){b._callValidation()},100);return}}this.options.validationFunction=a}a.call(this)}else{console.error("Validation Function not set for ncbiactivevalidation");console.info(this.element)}}},_keyUp:function(){this.runCheck()},_paste:function(){this.runCheck()},_blur:function(){this.runCheck(true)},_addEvents:function(){var a=this;this._keyupFnc=function(){a._keyUp()};this._pasteFnc=function(){a._paste()};
624 this._blurFnc=function(){a._blur()};this.element.on("keyup",this._keyupFnc).on("paste",this._pasteFnc).on("blur",this._blurFnc)},_addClasses:function(){var a=this.options.destElement,b=jQuery(a);if(!a){console.error("destElement is not set for ncbiactivevalidation");console.info(this.element)}b.addClass("ncbiactivevalidation_msg")},_removeClasses:function(){outElem.removeClass("ncbiactivevalidation_msg");this._lastTypeClass&&outElem.removeClass(this._lastTypeClass)},_removeEvents:function(){this.element.off("keyup",
625 this._keyupFnc).off("paste",this._pasteFnc).off("blur",this._blurFnc)},destroy:function(){this._removeTimer();this._removeEvents();this._removeClasses()},displayMessage:function(a,b){this._trigger("result","x",{type:a,message:b});var c=jQuery(this.options.destElement),d=a&&a.length>0?"ncbiactivevalidation_msg_"+a:null;c.html(b);d&&c.addClass(d);this._lastTypeClass&&this._lastTypeClass!==d&&c.removeClass(this._lastTypeClass);this._lastTypeClass=d;this._last=a},getValidationStatus:function(){return this._last||
626 null}});
627 (function(a,b){function c(){this.debug=false;this._curInst=null;this._keyEvent=false;this._disabledInputs=[];this._inDialog=this._datepickerShowing=false;this._mainDivId="ui-datepicker-div";this._inlineClass="ui-datepicker-inline";this._appendClass="ui-datepicker-append";this._triggerClass="ui-datepicker-trigger";this._dialogClass="ui-datepicker-dialog";this._disableClass="ui-datepicker-disabled";this._unselectableClass="ui-datepicker-unselectable";this._currentClass="ui-datepicker-current-day";this._dayOverClass=
628 "ui-datepicker-days-cell-over";this.regional=[];this.regional[""]={closeText:"Done",prevText:"Prev",nextText:"Next",currentText:"Today",monthNames:["January","February","March","April","May","June","July","August","September","October","November","December"],monthNamesShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayNames:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayNamesShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],dayNamesMin:["Su",
629 "Mo","Tu","We","Th","Fr","Sa"],weekHeader:"Wk",dateFormat:"mm/dd/yy",firstDay:0,isRTL:false,showMonthAfterYear:false,yearSuffix:""};this._defaults={showOn:"focus",showAnim:"fadeIn",showOptions:{},defaultDate:null,appendText:"",buttonText:"...",buttonImage:"",buttonImageOnly:false,hideIfNoPrevNext:false,navigationAsDateFormat:false,gotoCurrent:false,changeMonth:false,changeYear:false,yearRange:"c-10:c+10",showOtherMonths:false,selectOtherMonths:false,showWeek:false,calculateWeek:this.iso8601Week,shortYearCutoff:"+10",
630 minDate:null,maxDate:null,duration:"fast",beforeShowDay:null,beforeShow:null,onSelect:null,onChangeMonthYear:null,onClose:null,numberOfMonths:1,showCurrentAtPos:0,stepMonths:1,stepBigMonths:12,altField:"",altFormat:"",constrainInput:true,showButtonPanel:false,autoSize:false,disabled:false};a.extend(this._defaults,this.regional[""]);this.dpDiv=d(a('<div id="'+this._mainDivId+'" class="ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}function d(e){return e.bind("mouseout",
631 function(h){h=a(h.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");h.length&&h.removeClass("ui-state-hover ui-datepicker-prev-hover ui-datepicker-next-hover")}).bind("mouseover",function(h){h=a(h.target).closest("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a");if(!(a.datepicker._isDisabledDatepicker(i.inline?e.parent()[0]:i.input[0])||!h.length)){h.parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");
632 h.addClass("ui-state-hover");h.hasClass("ui-datepicker-prev")&&h.addClass("ui-datepicker-prev-hover");h.hasClass("ui-datepicker-next")&&h.addClass("ui-datepicker-next-hover")}})}function f(e,h){a.extend(e,h);for(var j in h)if(h[j]==null||h[j]==b)e[j]=h[j];return e}a.extend(a.ui,{datepicker:{version:"1.8.17"}});var g=(new Date).getTime(),i;a.extend(c.prototype,{markerClassName:"hasDatepicker",maxRows:4,log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},
633 setDefaults:function(e){f(this._defaults,e||{});return this},_attachDatepicker:function(e,h){var j=null;for(var k in this._defaults){var l=e.getAttribute("date:"+k);if(l){j=j||{};try{j[k]=eval(l)}catch(n){j[k]=l}}}k=e.nodeName.toLowerCase();l=k=="div"||k=="span";if(!e.id){this.uuid+=1;e.id="dp"+this.uuid}var s=this._newInst(a(e),l);s.settings=a.extend({},h||{},j||{});if(k=="input")this._connectDatepicker(e,s);else l&&this._inlineDatepicker(e,s)},_newInst:function(e,h){return{id:e[0].id.replace(/([^A-Za-z0-9_-])/g,
634 "\\\\$1"),input:e,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:h,dpDiv:!h?this.dpDiv:d(a('<div class="'+this._inlineClass+' ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all"></div>'))}},_connectDatepicker:function(e,h){var j=a(e);h.append=a([]);h.trigger=a([]);if(!j.hasClass(this.markerClassName)){this._attachments(j,h);j.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",
635 function(k,l,n){h.settings[l]=n}).bind("getData.datepicker",function(k,l){return this._get(h,l)});this._autoSize(h);a.data(e,"datepicker",h);h.settings.disabled&&this._disableDatepicker(e)}},_attachments:function(e,h){var j=this._get(h,"appendText"),k=this._get(h,"isRTL");h.append&&h.append.remove();if(j){h.append=a('<span class="'+this._appendClass+'">'+j+"</span>");e[k?"before":"after"](h.append)}e.unbind("focus",this._showDatepicker);h.trigger&&h.trigger.remove();j=this._get(h,"showOn");if(j==
636 "focus"||j=="both")e.focus(this._showDatepicker);if(j=="button"||j=="both"){j=this._get(h,"buttonText");var l=this._get(h,"buttonImage");h.trigger=a(this._get(h,"buttonImageOnly")?a("<img/>").addClass(this._triggerClass).attr({src:l,alt:j,title:j}):a('<button type="button"></button>').addClass(this._triggerClass).html(l==""?j:a("<img/>").attr({src:l,alt:j,title:j})));e[k?"before":"after"](h.trigger);h.trigger.click(function(){a.datepicker._datepickerShowing&&a.datepicker._lastInput==e[0]?a.datepicker._hideDatepicker():
637 a.datepicker._showDatepicker(e[0]);return false})}},_autoSize:function(e){if(this._get(e,"autoSize")&&!e.inline){var h=new Date(2009,11,20),j=this._get(e,"dateFormat");if(j.match(/[DM]/)){var k=function(l){for(var n=0,s=0,r=0;r<l.length;r++)if(l[r].length>n){n=l[r].length;s=r}return s};h.setMonth(k(this._get(e,j.match(/MM/)?"monthNames":"monthNamesShort")));h.setDate(k(this._get(e,j.match(/DD/)?"dayNames":"dayNamesShort"))+20-h.getDay())}e.input.attr("size",this._formatDate(e,h).length)}},_inlineDatepicker:function(e,
638 h){var j=a(e);if(!j.hasClass(this.markerClassName)){j.addClass(this.markerClassName).append(h.dpDiv).bind("setData.datepicker",function(k,l,n){h.settings[l]=n}).bind("getData.datepicker",function(k,l){return this._get(h,l)});a.data(e,"datepicker",h);this._setDate(h,this._getDefaultDate(h),true);this._updateDatepicker(h);this._updateAlternate(h);h.settings.disabled&&this._disableDatepicker(e);h.dpDiv.css("display","block")}},_dialogDatepicker:function(e,h,j,k,l){e=this._dialogInst;if(!e){this.uuid+=
639 1;this._dialogInput=a('<input type="text" id="'+("dp"+this.uuid)+'" style="position: absolute; top: -100px; width: 0px; z-index: -10;"/>');this._dialogInput.keydown(this._doKeyDown);a("body").append(this._dialogInput);e=this._dialogInst=this._newInst(this._dialogInput,false);e.settings={};a.data(this._dialogInput[0],"datepicker",e)}f(e.settings,k||{});h=h&&h.constructor==Date?this._formatDate(e,h):h;this._dialogInput.val(h);this._pos=l?l.length?l:[l.pageX,l.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/
640 2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");e.settings.onSelect=j;this._inDialog=true;this.dpDiv.addClass(this._dialogClass);this._showDatepicker(this._dialogInput[0]);a.blockUI&&a.blockUI(this.dpDiv);a.data(this._dialogInput[0],"datepicker",e);return this},_destroyDatepicker:function(e){var h=
641 a(e),j=a.data(e,"datepicker");if(h.hasClass(this.markerClassName)){var k=e.nodeName.toLowerCase();a.removeData(e,"datepicker");if(k=="input"){j.append.remove();j.trigger.remove();h.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup",this._doKeyUp)}else if(k=="div"||k=="span")h.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(e){var h=a(e),j=a.data(e,"datepicker");if(h.hasClass(this.markerClassName)){var k=
642 e.nodeName.toLowerCase();if(k=="input"){e.disabled=false;j.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(k=="div"||k=="span"){h=h.children("."+this._inlineClass);h.children().removeClass("ui-state-disabled");h.find("select.ui-datepicker-month, select.ui-datepicker-year").removeAttr("disabled")}this._disabledInputs=a.map(this._disabledInputs,function(l){return l==e?null:l})}},_disableDatepicker:function(e){var h=a(e),j=a.data(e,
643 "datepicker");if(h.hasClass(this.markerClassName)){var k=e.nodeName.toLowerCase();if(k=="input"){e.disabled=true;j.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(k=="div"||k=="span"){h=h.children("."+this._inlineClass);h.children().addClass("ui-state-disabled");h.find("select.ui-datepicker-month, select.ui-datepicker-year").attr("disabled","disabled")}this._disabledInputs=a.map(this._disabledInputs,function(l){return l==
644 e?null:l});this._disabledInputs[this._disabledInputs.length]=e}},_isDisabledDatepicker:function(e){if(!e)return false;for(var h=0;h<this._disabledInputs.length;h++)if(this._disabledInputs[h]==e)return true;return false},_getInst:function(e){try{return a.data(e,"datepicker")}catch(h){throw"Missing instance data for this datepicker";}},_optionDatepicker:function(e,h,j){var k=this._getInst(e);if(arguments.length==2&&typeof h=="string")return h=="defaults"?a.extend({},a.datepicker._defaults):k?h=="all"?
645 a.extend({},k.settings):this._get(k,h):null;var l=h||{};if(typeof h=="string"){l={};l[h]=j}if(k){this._curInst==k&&this._hideDatepicker();var n=this._getDateDatepicker(e,true),s=this._getMinMaxDate(k,"min"),r=this._getMinMaxDate(k,"max");f(k.settings,l);if(s!==null&&l.dateFormat!==b&&l.minDate===b)k.settings.minDate=this._formatDate(k,s);if(r!==null&&l.dateFormat!==b&&l.maxDate===b)k.settings.maxDate=this._formatDate(k,r);this._attachments(a(e),k);this._autoSize(k);this._setDate(k,n);this._updateAlternate(k);
646 this._updateDatepicker(k)}},_changeDatepicker:function(e,h,j){this._optionDatepicker(e,h,j)},_refreshDatepicker:function(e){(e=this._getInst(e))&&this._updateDatepicker(e)},_setDateDatepicker:function(e,h){if(e=this._getInst(e)){this._setDate(e,h);this._updateDatepicker(e);this._updateAlternate(e)}},_getDateDatepicker:function(e,h){(e=this._getInst(e))&&!e.inline&&this._setDateFromField(e,h);return e?this._getDate(e):null},_doKeyDown:function(e){var h=a.datepicker._getInst(e.target),j=true,k=h.dpDiv.is(".ui-datepicker-rtl");
647 h._keyEvent=true;if(a.datepicker._datepickerShowing)switch(e.keyCode){case 9:a.datepicker._hideDatepicker();j=false;break;case 13:j=a("td."+a.datepicker._dayOverClass+":not(."+a.datepicker._currentClass+")",h.dpDiv);j[0]&&a.datepicker._selectDay(e.target,h.selectedMonth,h.selectedYear,j[0]);if(e=a.datepicker._get(h,"onSelect")){j=a.datepicker._formatDate(h);e.apply(h.input?h.input[0]:null,[j,h])}else a.datepicker._hideDatepicker();return false;case 27:a.datepicker._hideDatepicker();break;case 33:a.datepicker._adjustDate(e.target,
648 e.ctrlKey?-a.datepicker._get(h,"stepBigMonths"):-a.datepicker._get(h,"stepMonths"),"M");break;case 34:a.datepicker._adjustDate(e.target,e.ctrlKey?+a.datepicker._get(h,"stepBigMonths"):+a.datepicker._get(h,"stepMonths"),"M");break;case 35:if(e.ctrlKey||e.metaKey)a.datepicker._clearDate(e.target);j=e.ctrlKey||e.metaKey;break;case 36:if(e.ctrlKey||e.metaKey)a.datepicker._gotoToday(e.target);j=e.ctrlKey||e.metaKey;break;case 37:if(e.ctrlKey||e.metaKey)a.datepicker._adjustDate(e.target,k?+1:-1,"D");j=
649 e.ctrlKey||e.metaKey;if(e.originalEvent.altKey)a.datepicker._adjustDate(e.target,e.ctrlKey?-a.datepicker._get(h,"stepBigMonths"):-a.datepicker._get(h,"stepMonths"),"M");break;case 38:if(e.ctrlKey||e.metaKey)a.datepicker._adjustDate(e.target,-7,"D");j=e.ctrlKey||e.metaKey;break;case 39:if(e.ctrlKey||e.metaKey)a.datepicker._adjustDate(e.target,k?-1:+1,"D");j=e.ctrlKey||e.metaKey;if(e.originalEvent.altKey)a.datepicker._adjustDate(e.target,e.ctrlKey?+a.datepicker._get(h,"stepBigMonths"):+a.datepicker._get(h,
650 "stepMonths"),"M");break;case 40:if(e.ctrlKey||e.metaKey)a.datepicker._adjustDate(e.target,+7,"D");j=e.ctrlKey||e.metaKey;break;default:j=false}else if(e.keyCode==36&&e.ctrlKey)a.datepicker._showDatepicker(this);else j=false;if(j){e.preventDefault();e.stopPropagation()}},_doKeyPress:function(e){var h=a.datepicker._getInst(e.target);if(a.datepicker._get(h,"constrainInput")){h=a.datepicker._possibleChars(a.datepicker._get(h,"dateFormat"));var j=String.fromCharCode(e.charCode==b?e.keyCode:e.charCode);
651 return e.ctrlKey||e.metaKey||j<" "||!h||h.indexOf(j)>-1}},_doKeyUp:function(e){e=a.datepicker._getInst(e.target);if(e.input.val()!=e.lastVal)try{if(a.datepicker.parseDate(a.datepicker._get(e,"dateFormat"),e.input?e.input.val():null,a.datepicker._getFormatConfig(e))){a.datepicker._setDateFromField(e);a.datepicker._updateAlternate(e);a.datepicker._updateDatepicker(e)}}catch(h){a.datepicker.log(h)}return true},_showDatepicker:function(e){e=e.target||e;if(e.nodeName.toLowerCase()!="input")e=a("input",
652 e.parentNode)[0];if(!(a.datepicker._isDisabledDatepicker(e)||a.datepicker._lastInput==e)){var h=a.datepicker._getInst(e);if(a.datepicker._curInst&&a.datepicker._curInst!=h){a.datepicker._curInst.dpDiv.stop(true,true);h&&a.datepicker._datepickerShowing&&a.datepicker._hideDatepicker(a.datepicker._curInst.input[0])}var j=a.datepicker._get(h,"beforeShow");j=j?j.apply(e,[e,h]):{};if(j!==false){f(h.settings,j);h.lastVal=null;a.datepicker._lastInput=e;a.datepicker._setDateFromField(h);if(a.datepicker._inDialog)e.value=
653 "";if(!a.datepicker._pos){a.datepicker._pos=a.datepicker._findPos(e);a.datepicker._pos[1]+=e.offsetHeight}var k=false;a(e).parents().each(function(){k|=a(this).css("position")=="fixed";return!k});if(k&&a.browser.opera){a.datepicker._pos[0]-=document.documentElement.scrollLeft;a.datepicker._pos[1]-=document.documentElement.scrollTop}j={left:a.datepicker._pos[0],top:a.datepicker._pos[1]};a.datepicker._pos=null;h.dpDiv.empty();h.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});a.datepicker._updateDatepicker(h);
654 j=a.datepicker._checkOffset(h,j,k);h.dpDiv.css({position:a.datepicker._inDialog&&a.blockUI?"static":k?"fixed":"absolute",display:"none",left:j.left+"px",top:j.top+"px"});if(!h.inline){j=a.datepicker._get(h,"showAnim");var l=a.datepicker._get(h,"duration"),n=function(){var s=h.dpDiv.find("iframe.ui-datepicker-cover");if(s.length){var r=a.datepicker._getBorders(h.dpDiv);s.css({left:-r[0],top:-r[1],width:h.dpDiv.outerWidth(),height:h.dpDiv.outerHeight()})}};h.dpDiv.zIndex(a(e).zIndex()+1);a.datepicker._datepickerShowing=
655 true;a.effects&&a.effects[j]?h.dpDiv.show(j,a.datepicker._get(h,"showOptions"),l,n):h.dpDiv[j||"show"](j?l:null,n);if(!j||!l)n();h.input.is(":visible")&&!h.input.is(":disabled")&&h.input.focus();a.datepicker._curInst=h}}}},_updateDatepicker:function(e){this.maxRows=4;var h=a.datepicker._getBorders(e.dpDiv);i=e;e.dpDiv.empty().append(this._generateHTML(e));var j=e.dpDiv.find("iframe.ui-datepicker-cover");j.length&&j.css({left:-h[0],top:-h[1],width:e.dpDiv.outerWidth(),height:e.dpDiv.outerHeight()});
656 e.dpDiv.find("."+this._dayOverClass+" a").mouseover();h=this._getNumberOfMonths(e);j=h[1];e.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");j>1&&e.dpDiv.addClass("ui-datepicker-multi-"+j).css("width",17*j+"em");e.dpDiv[(h[0]!=1||h[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");e.dpDiv[(this._get(e,"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");e==a.datepicker._curInst&&a.datepicker._datepickerShowing&&e.input&&e.input.is(":visible")&&
657 !e.input.is(":disabled")&&e.input[0]!=document.activeElement&&e.input.focus();if(e.yearshtml){var k=e.yearshtml;setTimeout(function(){k===e.yearshtml&&e.yearshtml&&e.dpDiv.find("select.ui-datepicker-year:first").replaceWith(e.yearshtml);k=e.yearshtml=null},0)}},_getBorders:function(e){var h=function(j){return{thin:1,medium:2,thick:3}[j]||j};return[parseFloat(h(e.css("border-left-width"))),parseFloat(h(e.css("border-top-width")))]},_checkOffset:function(e,h,j){var k=e.dpDiv.outerWidth(),l=e.dpDiv.outerHeight(),
658 n=e.input?e.input.outerWidth():0,s=e.input?e.input.outerHeight():0,r=document.documentElement.clientWidth+a(document).scrollLeft(),v=document.documentElement.clientHeight+a(document).scrollTop();h.left-=this._get(e,"isRTL")?k-n:0;h.left-=j&&h.left==e.input.offset().left?a(document).scrollLeft():0;h.top-=j&&h.top==e.input.offset().top+s?a(document).scrollTop():0;h.left-=Math.min(h.left,h.left+k>r&&r>k?Math.abs(h.left+k-r):0);h.top-=Math.min(h.top,h.top+l>v&&v>l?Math.abs(l+s):0);return h},_findPos:function(e){for(var h=
659 this._get(this._getInst(e),"isRTL");e&&(e.type=="hidden"||e.nodeType!=1||a.expr.filters.hidden(e));)e=e[h?"previousSibling":"nextSibling"];e=a(e).offset();return[e.left,e.top]},_hideDatepicker:function(e){var h=this._curInst;if(!(!h||e&&h!=a.data(e,"datepicker")))if(this._datepickerShowing){e=this._get(h,"showAnim");var j=this._get(h,"duration"),k=this,l=function(){a.datepicker._tidyDialog(h);k._curInst=null};a.effects&&a.effects[e]?h.dpDiv.hide(e,a.datepicker._get(h,"showOptions"),j,l):h.dpDiv[e==
660 "slideDown"?"slideUp":e=="fadeIn"?"fadeOut":"hide"](e?j:null,l);e||l();this._datepickerShowing=false;if(e=this._get(h,"onClose"))e.apply(h.input?h.input[0]:null,[h.input?h.input.val():"",h]);this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(a.blockUI){a.unblockUI();a("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(e){e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")},_checkExternalClick:function(e){if(a.datepicker._curInst){e=
661 a(e.target);var h=a.datepicker._getInst(e[0]);if(e[0].id!=a.datepicker._mainDivId&&e.parents("#"+a.datepicker._mainDivId).length==0&&!e.hasClass(a.datepicker.markerClassName)&&!e.hasClass(a.datepicker._triggerClass)&&a.datepicker._datepickerShowing&&!(a.datepicker._inDialog&&a.blockUI)||e.hasClass(a.datepicker.markerClassName)&&a.datepicker._curInst!=h)a.datepicker._hideDatepicker()}},_adjustDate:function(e,h,j){e=a(e);var k=this._getInst(e[0]);if(!this._isDisabledDatepicker(e[0])){this._adjustInstDate(k,
662 h+(j=="M"?this._get(k,"showCurrentAtPos"):0),j);this._updateDatepicker(k)}},_gotoToday:function(e){e=a(e);var h=this._getInst(e[0]);if(this._get(h,"gotoCurrent")&&h.currentDay){h.selectedDay=h.currentDay;h.drawMonth=h.selectedMonth=h.currentMonth;h.drawYear=h.selectedYear=h.currentYear}else{var j=new Date;h.selectedDay=j.getDate();h.drawMonth=h.selectedMonth=j.getMonth();h.drawYear=h.selectedYear=j.getFullYear()}this._notifyChange(h);this._adjustDate(e)},_selectMonthYear:function(e,h,j){e=a(e);var k=
663 this._getInst(e[0]);k["selected"+(j=="M"?"Month":"Year")]=k["draw"+(j=="M"?"Month":"Year")]=parseInt(h.options[h.selectedIndex].value,10);this._notifyChange(k);this._adjustDate(e)},_selectDay:function(e,h,j,k){var l=a(e);if(!(a(k).hasClass(this._unselectableClass)||this._isDisabledDatepicker(l[0]))){l=this._getInst(l[0]);l.selectedDay=l.currentDay=a("a",k).html();l.selectedMonth=l.currentMonth=h;l.selectedYear=l.currentYear=j;this._selectDate(e,this._formatDate(l,l.currentDay,l.currentMonth,l.currentYear))}},
664 _clearDate:function(e){e=a(e);this._getInst(e[0]);this._selectDate(e,"")},_selectDate:function(e,h){e=this._getInst(a(e)[0]);h=h!=null?h:this._formatDate(e);e.input&&e.input.val(h);this._updateAlternate(e);var j=this._get(e,"onSelect");if(j)j.apply(e.input?e.input[0]:null,[h,e]);else e.input&&e.input.trigger("change");if(e.inline)this._updateDatepicker(e);else{this._hideDatepicker();this._lastInput=e.input[0];typeof e.input[0]!="object"&&e.input.focus();this._lastInput=null}},_updateAlternate:function(e){var h=
665 this._get(e,"altField");if(h){var j=this._get(e,"altFormat")||this._get(e,"dateFormat"),k=this._getDate(e),l=this.formatDate(j,k,this._getFormatConfig(e));a(h).each(function(){a(this).val(l)})}},noWeekends:function(e){e=e.getDay();return[e>0&&e<6,""]},iso8601Week:function(e){e=new Date(e.getTime());e.setDate(e.getDate()+4-(e.getDay()||7));var h=e.getTime();e.setMonth(0);e.setDate(1);return Math.floor(Math.round((h-e)/864E5)/7)+1},parseDate:function(e,h,j){if(e==null||h==null)throw"Invalid arguments";
666 h=typeof h=="object"?h.toString():h+"";if(h=="")return null;var k=(j?j.shortYearCutoff:null)||this._defaults.shortYearCutoff;k=typeof k!="string"?k:(new Date).getFullYear()%100+parseInt(k,10);for(var l=(j?j.dayNamesShort:null)||this._defaults.dayNamesShort,n=(j?j.dayNames:null)||this._defaults.dayNames,s=(j?j.monthNamesShort:null)||this._defaults.monthNamesShort,r=(j?j.monthNames:null)||this._defaults.monthNames,v=j=-1,o=-1,q=-1,m=false,p=function(A){(A=C+1<e.length&&e.charAt(C+1)==A)&&C++;return A},
667 u=function(A){var E=p(A);A=new RegExp("^\\d{1,"+(A=="@"?14:A=="!"?20:A=="y"&&E?4:A=="o"?3:2)+"}");A=h.substring(y).match(A);if(!A)throw"Missing number at position "+y;y+=A[0].length;return parseInt(A[0],10)},x=function(A,E,R){A=a.map(p(A)?R:E,function(G,J){return[[J,G]]}).sort(function(G,J){return-(G[1].length-J[1].length)});var M=-1;a.each(A,function(G,J){G=J[1];if(h.substr(y,G.length).toLowerCase()==G.toLowerCase()){M=J[0];y+=G.length;return false}});if(M!=-1)return M+1;else throw"Unknown name at position "+
668 y;},w=function(){if(h.charAt(y)!=e.charAt(C))throw"Unexpected literal at position "+y;y++},y=0,C=0;C<e.length;C++)if(m)if(e.charAt(C)=="'"&&!p("'"))m=false;else w();else switch(e.charAt(C)){case "d":o=u("d");break;case "D":x("D",l,n);break;case "o":q=u("o");break;case "m":v=u("m");break;case "M":v=x("M",s,r);break;case "y":j=u("y");break;case "@":var D=new Date(u("@"));j=D.getFullYear();v=D.getMonth()+1;o=D.getDate();break;case "!":D=new Date((u("!")-this._ticksTo1970)/1E4);j=D.getFullYear();v=D.getMonth()+
669 1;o=D.getDate();break;case "'":if(p("'"))w();else m=true;break;default:w()}if(y<h.length)throw"Extra/unparsed characters found in date: "+h.substring(y);if(j==-1)j=(new Date).getFullYear();else if(j<100)j+=(new Date).getFullYear()-(new Date).getFullYear()%100+(j<=k?0:-100);if(q>-1){v=1;o=q;do{k=this._getDaysInMonth(j,v-1);if(o<=k)break;v++;o-=k}while(1)}D=this._daylightSavingAdjust(new Date(j,v-1,o));if(D.getFullYear()!=j||D.getMonth()+1!=v||D.getDate()!=o)throw"Invalid date";return D},ATOM:"yy-mm-dd",
670 COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y",RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(e,h,j){if(!h)return"";var k=(j?j.dayNamesShort:null)||this._defaults.dayNamesShort,l=(j?j.dayNames:null)||this._defaults.dayNames,n=(j?j.monthNamesShort:null)||this._defaults.monthNamesShort;j=(j?j.monthNames:
671 null)||this._defaults.monthNames;var s=function(p){(p=m+1<e.length&&e.charAt(m+1)==p)&&m++;return p},r=function(p,u,x){u=""+u;if(s(p))for(;u.length<x;)u="0"+u;return u},v=function(p,u,x,w){return s(p)?w[u]:x[u]},o="",q=false;if(h)for(var m=0;m<e.length;m++)if(q)if(e.charAt(m)=="'"&&!s("'"))q=false;else o+=e.charAt(m);else switch(e.charAt(m)){case "d":o+=r("d",h.getDate(),2);break;case "D":o+=v("D",h.getDay(),k,l);break;case "o":o+=r("o",Math.round(((new Date(h.getFullYear(),h.getMonth(),h.getDate())).getTime()-
672 (new Date(h.getFullYear(),0,0)).getTime())/864E5),3);break;case "m":o+=r("m",h.getMonth()+1,2);break;case "M":o+=v("M",h.getMonth(),n,j);break;case "y":o+=s("y")?h.getFullYear():(h.getYear()%100<10?"0":"")+h.getYear()%100;break;case "@":o+=h.getTime();break;case "!":o+=h.getTime()*1E4+this._ticksTo1970;break;case "'":if(s("'"))o+="'";else q=true;break;default:o+=e.charAt(m)}return o},_possibleChars:function(e){for(var h="",j=false,k=function(n){(n=l+1<e.length&&e.charAt(l+1)==n)&&l++;return n},l=
673 0;l<e.length;l++)if(j)if(e.charAt(l)=="'"&&!k("'"))j=false;else h+=e.charAt(l);else switch(e.charAt(l)){case "d":case "m":case "y":case "@":h+="0123456789";break;case "D":case "M":return null;case "'":if(k("'"))h+="'";else j=true;break;default:h+=e.charAt(l)}return h},_get:function(e,h){return e.settings[h]!==b?e.settings[h]:this._defaults[h]},_setDateFromField:function(e,h){if(e.input.val()!=e.lastVal){var j=this._get(e,"dateFormat"),k=e.lastVal=e.input?e.input.val():null,l,n;l=n=this._getDefaultDate(e);
674 var s=this._getFormatConfig(e);try{l=this.parseDate(j,k,s)||n}catch(r){this.log(r);k=h?"":k}e.selectedDay=l.getDate();e.drawMonth=e.selectedMonth=l.getMonth();e.drawYear=e.selectedYear=l.getFullYear();e.currentDay=k?l.getDate():0;e.currentMonth=k?l.getMonth():0;e.currentYear=k?l.getFullYear():0;this._adjustInstDate(e)}},_getDefaultDate:function(e){return this._restrictMinMax(e,this._determineDate(e,this._get(e,"defaultDate"),new Date))},_determineDate:function(e,h,j){var k=function(n){var s=new Date;
675 s.setDate(s.getDate()+n);return s},l=function(n){try{return a.datepicker.parseDate(a.datepicker._get(e,"dateFormat"),n,a.datepicker._getFormatConfig(e))}catch(s){}var r=(n.toLowerCase().match(/^c/)?a.datepicker._getDate(e):null)||new Date,v=r.getFullYear(),o=r.getMonth();r=r.getDate();for(var q=/([+-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g,m=q.exec(n);m;){switch(m[2]||"d"){case "d":case "D":r+=parseInt(m[1],10);break;case "w":case "W":r+=parseInt(m[1],10)*7;break;case "m":case "M":o+=parseInt(m[1],10);r=
676 Math.min(r,a.datepicker._getDaysInMonth(v,o));break;case "y":case "Y":v+=parseInt(m[1],10);r=Math.min(r,a.datepicker._getDaysInMonth(v,o));break}m=q.exec(n)}return new Date(v,o,r)};if(h=(h=h==null||h===""?j:typeof h=="string"?l(h):typeof h=="number"?isNaN(h)?j:k(h):new Date(h.getTime()))&&h.toString()=="Invalid Date"?j:h){h.setHours(0);h.setMinutes(0);h.setSeconds(0);h.setMilliseconds(0)}return this._daylightSavingAdjust(h)},_daylightSavingAdjust:function(e){if(!e)return null;e.setHours(e.getHours()>
677 12?e.getHours()+2:0);return e},_setDate:function(e,h,j){var k=!h,l=e.selectedMonth,n=e.selectedYear;h=this._restrictMinMax(e,this._determineDate(e,h,new Date));e.selectedDay=e.currentDay=h.getDate();e.drawMonth=e.selectedMonth=e.currentMonth=h.getMonth();e.drawYear=e.selectedYear=e.currentYear=h.getFullYear();if((l!=e.selectedMonth||n!=e.selectedYear)&&!j)this._notifyChange(e);this._adjustInstDate(e);if(e.input)e.input.val(k?"":this._formatDate(e))},_getDate:function(e){return!e.currentYear||e.input&&
678 e.input.val()==""?null:this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay))},_generateHTML:function(e){var h=new Date;h=this._daylightSavingAdjust(new Date(h.getFullYear(),h.getMonth(),h.getDate()));var j=this._get(e,"isRTL"),k=this._get(e,"showButtonPanel"),l=this._get(e,"hideIfNoPrevNext"),n=this._get(e,"navigationAsDateFormat"),s=this._getNumberOfMonths(e),r=this._get(e,"showCurrentAtPos"),v=this._get(e,"stepMonths"),o=s[0]!=1||s[1]!=1,q=this._daylightSavingAdjust(!e.currentDay?
679 new Date(9999,9,9):new Date(e.currentYear,e.currentMonth,e.currentDay)),m=this._getMinMaxDate(e,"min"),p=this._getMinMaxDate(e,"max");r=e.drawMonth-r;var u=e.drawYear;if(r<0){r+=12;u--}if(p){var x=this._daylightSavingAdjust(new Date(p.getFullYear(),p.getMonth()-s[0]*s[1]+1,p.getDate()));for(x=m&&x<m?m:x;this._daylightSavingAdjust(new Date(u,r,1))>x;){r--;if(r<0){r=11;u--}}}e.drawMonth=r;e.drawYear=u;x=this._get(e,"prevText");x=!n?x:this.formatDate(x,this._daylightSavingAdjust(new Date(u,r-v,1)),this._getFormatConfig(e));
680 x=this._canAdjustMonth(e,-1,u,r)?'<a class="ui-datepicker-prev ui-corner-all" onclick="DP_jQuery_'+g+".datepicker._adjustDate('#"+e.id+"', -"+v+", 'M');\" title=\""+x+'"><span class="ui-icon ui-icon-circle-triangle-'+(j?"e":"w")+'">'+x+"</span></a>":l?"":'<a class="ui-datepicker-prev ui-corner-all ui-state-disabled" title="'+x+'"><span class="ui-icon ui-icon-circle-triangle-'+(j?"e":"w")+'">'+x+"</span></a>";var w=this._get(e,"nextText");w=!n?w:this.formatDate(w,this._daylightSavingAdjust(new Date(u,
681 r+v,1)),this._getFormatConfig(e));l=this._canAdjustMonth(e,+1,u,r)?'<a class="ui-datepicker-next ui-corner-all" onclick="DP_jQuery_'+g+".datepicker._adjustDate('#"+e.id+"', +"+v+", 'M');\" title=\""+w+'"><span class="ui-icon ui-icon-circle-triangle-'+(j?"w":"e")+'">'+w+"</span></a>":l?"":'<a class="ui-datepicker-next ui-corner-all ui-state-disabled" title="'+w+'"><span class="ui-icon ui-icon-circle-triangle-'+(j?"w":"e")+'">'+w+"</span></a>";v=this._get(e,"currentText");w=this._get(e,"gotoCurrent")&&
682 e.currentDay?q:h;v=!n?v:this.formatDate(v,w,this._getFormatConfig(e));n=!e.inline?'<button type="button" class="ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all" onclick="DP_jQuery_'+g+'.datepicker._hideDatepicker();">'+this._get(e,"closeText")+"</button>":"";k=k?'<div class="ui-datepicker-buttonpane ui-widget-content">'+(j?n:"")+(this._isInRange(e,w)?'<button type="button" class="ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all" onclick="DP_jQuery_'+
683 g+".datepicker._gotoToday('#"+e.id+"');\">"+v+"</button>":"")+(j?"":n)+"</div>":"";n=parseInt(this._get(e,"firstDay"),10);n=isNaN(n)?0:n;v=this._get(e,"showWeek");w=this._get(e,"dayNames");this._get(e,"dayNamesShort");var y=this._get(e,"dayNamesMin"),C=this._get(e,"monthNames"),D=this._get(e,"monthNamesShort"),A=this._get(e,"beforeShowDay"),E=this._get(e,"showOtherMonths"),R=this._get(e,"selectOtherMonths");this._get(e,"calculateWeek");for(var M=this._getDefaultDate(e),G="",J=0;J<s[0];J++){var S=
684 "";this.maxRows=4;for(var K=0;K<s[1];K++){var N=this._daylightSavingAdjust(new Date(u,r,e.selectedDay)),B=" ui-corner-all",F="";if(o){F+='<div class="ui-datepicker-group';if(s[1]>1)switch(K){case 0:F+=" ui-datepicker-group-first";B=" ui-corner-"+(j?"right":"left");break;case s[1]-1:F+=" ui-datepicker-group-last";B=" ui-corner-"+(j?"left":"right");break;default:F+=" ui-datepicker-group-middle";B="";break}F+='">'}F+='<div class="ui-datepicker-header ui-widget-header ui-helper-clearfix'+B+'">'+(/all|left/.test(B)&&
685 J==0?j?l:x:"")+(/all|right/.test(B)&&J==0?j?x:l:"")+this._generateMonthYearHeader(e,r,u,m,p,J>0||K>0,C,D)+'</div><table class="ui-datepicker-calendar"><thead><tr>';var H=v?'<th class="ui-datepicker-week-col">'+this._get(e,"weekHeader")+"</th>":"";for(B=0;B<7;B++){var z=(B+n)%7;H+="<th"+((B+n+6)%7>=5?' class="ui-datepicker-week-end"':"")+'><span title="'+w[z]+'">'+y[z]+"</span></th>"}F+=H+"</tr></thead><tbody>";H=this._getDaysInMonth(u,r);if(u==e.selectedYear&&r==e.selectedMonth)e.selectedDay=Math.min(e.selectedDay,
686 H);B=(this._getFirstDayOfMonth(u,r)-n+7)%7;H=Math.ceil((B+H)/7);this.maxRows=H=o?this.maxRows>H?this.maxRows:H:H;z=this._daylightSavingAdjust(new Date(u,r,1-B));for(var O=0;O<H;O++){F+="<tr>";var T=!v?"":'<td class="ui-datepicker-week-col">'+this._get(e,"calculateWeek")(z)+"</td>";for(B=0;B<7;B++){var P=A?A.apply(e.input?e.input[0]:null,[z]):[true,""],I=z.getMonth()!=r,Q=I&&!R||!P[0]||m&&z<m||p&&z>p;T+='<td class="'+((B+n+6)%7>=5?" ui-datepicker-week-end":"")+(I?" ui-datepicker-other-month":"")+(z.getTime()==
687 N.getTime()&&r==e.selectedMonth&&e._keyEvent||M.getTime()==z.getTime()&&M.getTime()==N.getTime()?" "+this._dayOverClass:"")+(Q?" "+this._unselectableClass+" ui-state-disabled":"")+(I&&!E?"":" "+P[1]+(z.getTime()==q.getTime()?" "+this._currentClass:"")+(z.getTime()==h.getTime()?" ui-datepicker-today":""))+'"'+((!I||E)&&P[2]?' title="'+P[2]+'"':"")+(Q?"":' onclick="DP_jQuery_'+g+".datepicker._selectDay('#"+e.id+"',"+z.getMonth()+","+z.getFullYear()+', this);return false;"')+">"+(I&&!E?"&#xa0;":Q?'<span class="ui-state-default">'+
688 z.getDate()+"</span>":'<a class="ui-state-default'+(z.getTime()==h.getTime()?" ui-state-highlight":"")+(z.getTime()==q.getTime()?" ui-state-active":"")+(I?" ui-priority-secondary":"")+'" href="#">'+z.getDate()+"</a>")+"</td>";z.setDate(z.getDate()+1);z=this._daylightSavingAdjust(z)}F+=T+"</tr>"}r++;if(r>11){r=0;u++}F+="</tbody></table>"+(o?"</div>"+(s[0]>0&&K==s[1]-1?'<div class="ui-datepicker-row-break"></div>':""):"");S+=F}G+=S}G+=k+(a.browser.msie&&parseInt(a.browser.version,10)<7&&!e.inline?'<iframe src="javascript:false;" class="ui-datepicker-cover" frameborder="0"></iframe>':
689 "");e._keyEvent=false;return G},_generateMonthYearHeader:function(e,h,j,k,l,n,s,r){var v=this._get(e,"changeMonth"),o=this._get(e,"changeYear"),q=this._get(e,"showMonthAfterYear"),m='<div class="ui-datepicker-title">',p="";if(n||!v)p+='<span class="ui-datepicker-month">'+s[h]+"</span>";else{s=k&&k.getFullYear()==j;var u=l&&l.getFullYear()==j;p+='<select class="ui-datepicker-month" onchange="DP_jQuery_'+g+".datepicker._selectMonthYear('#"+e.id+"', this, 'M');\" >";for(var x=0;x<12;x++)if((!s||x>=k.getMonth())&&
690 (!u||x<=l.getMonth()))p+='<option value="'+x+'"'+(x==h?' selected="selected"':"")+">"+r[x]+"</option>";p+="</select>"}q||(m+=p+(n||!(v&&o)?"&#xa0;":""));if(!e.yearshtml){e.yearshtml="";if(n||!o)m+='<span class="ui-datepicker-year">'+j+"</span>";else{r=this._get(e,"yearRange").split(":");var w=(new Date).getFullYear();s=function(y){y=y.match(/c[+-].*/)?j+parseInt(y.substring(1),10):y.match(/[+-].*/)?w+parseInt(y,10):parseInt(y,10);return isNaN(y)?w:y};h=s(r[0]);r=Math.max(h,s(r[1]||""));h=k?Math.max(h,
691 k.getFullYear()):h;r=l?Math.min(r,l.getFullYear()):r;for(e.yearshtml+='<select class="ui-datepicker-year" onchange="DP_jQuery_'+g+".datepicker._selectMonthYear('#"+e.id+"', this, 'Y');\" >";h<=r;h++)e.yearshtml+='<option value="'+h+'"'+(h==j?' selected="selected"':"")+">"+h+"</option>";e.yearshtml+="</select>";m+=e.yearshtml;e.yearshtml=null}}m+=this._get(e,"yearSuffix");if(q)m+=(n||!(v&&o)?"&#xa0;":"")+p;m+="</div>";return m},_adjustInstDate:function(e,h,j){var k=e.drawYear+(j=="Y"?h:0),l=e.drawMonth+
692 (j=="M"?h:0);h=Math.min(e.selectedDay,this._getDaysInMonth(k,l))+(j=="D"?h:0);k=this._restrictMinMax(e,this._daylightSavingAdjust(new Date(k,l,h)));e.selectedDay=k.getDate();e.drawMonth=e.selectedMonth=k.getMonth();e.drawYear=e.selectedYear=k.getFullYear();if(j=="M"||j=="Y")this._notifyChange(e)},_restrictMinMax:function(e,h){var j=this._getMinMaxDate(e,"min");e=this._getMinMaxDate(e,"max");h=j&&h<j?j:h;return h=e&&h>e?e:h},_notifyChange:function(e){var h=this._get(e,"onChangeMonthYear");if(h)h.apply(e.input?
693 e.input[0]:null,[e.selectedYear,e.selectedMonth+1,e])},_getNumberOfMonths:function(e){e=this._get(e,"numberOfMonths");return e==null?[1,1]:typeof e=="number"?[1,e]:e},_getMinMaxDate:function(e,h){return this._determineDate(e,this._get(e,h+"Date"),null)},_getDaysInMonth:function(e,h){return 32-this._daylightSavingAdjust(new Date(e,h,32)).getDate()},_getFirstDayOfMonth:function(e,h){return(new Date(e,h,1)).getDay()},_canAdjustMonth:function(e,h,j,k){var l=this._getNumberOfMonths(e);j=this._daylightSavingAdjust(new Date(j,
694 k+(h<0?h:l[0]*l[1]),1));h<0&&j.setDate(this._getDaysInMonth(j.getFullYear(),j.getMonth()));return this._isInRange(e,j)},_isInRange:function(e,h){var j=this._getMinMaxDate(e,"min");e=this._getMinMaxDate(e,"max");return(!j||h.getTime()>=j.getTime())&&(!e||h.getTime()<=e.getTime())},_getFormatConfig:function(e){var h=this._get(e,"shortYearCutoff");h=typeof h!="string"?h:(new Date).getFullYear()%100+parseInt(h,10);return{shortYearCutoff:h,dayNamesShort:this._get(e,"dayNamesShort"),dayNames:this._get(e,
695 "dayNames"),monthNamesShort:this._get(e,"monthNamesShort"),monthNames:this._get(e,"monthNames")}},_formatDate:function(e,h,j,k){if(!h){e.currentDay=e.selectedDay;e.currentMonth=e.selectedMonth;e.currentYear=e.selectedYear}h=h?typeof h=="object"?h:this._daylightSavingAdjust(new Date(k,j,h)):this._daylightSavingAdjust(new Date(e.currentYear,e.currentMonth,e.currentDay));return this.formatDate(this._get(e,"dateFormat"),h,this._getFormatConfig(e))}});a.fn.datepicker=function(e){if(!this.length)return this;
696 if(!a.datepicker.initialized){a(document).mousedown(a.datepicker._checkExternalClick).find("body").append(a.datepicker.dpDiv);a.datepicker.initialized=true}var h=Array.prototype.slice.call(arguments,1);if(typeof e=="string"&&(e=="isDisabled"||e=="getDate"||e=="widget"))return a.datepicker["_"+e+"Datepicker"].apply(a.datepicker,[this[0]].concat(h));if(e=="option"&&arguments.length==2&&typeof arguments[1]=="string")return a.datepicker["_"+e+"Datepicker"].apply(a.datepicker,[this[0]].concat(h));return this.each(function(){typeof e==
697 "string"?a.datepicker["_"+e+"Datepicker"].apply(a.datepicker,[this].concat(h)):a.datepicker._attachDatepicker(this,e)})};a.datepicker=new c;a.datepicker.initialized=false;a.datepicker.uuid=(new Date).getTime();a.datepicker.version="1.8.17";window["DP_jQuery_"+g]=a})(jQuery);
698 (function(a){a.widget("ui.ncbidatepicker",{_create:function(){var b=["beforeShow","beforeShowDay","onChangeMonthYear","onClose","onSelect"],c=this.options;for(var d in c)if(a.inArray(d,b)!==-1)this.options[d]=a.ui.jig._getFncFromStr(this.options[d],this);this.element.datepicker(this.options)},show:function(){for(var b=[],c=0;c<arguments.length;c++)b.push(arguments[c]);return this.element.datepicker.apply(this.element,["show"].concat(b))},hide:function(){for(var b=[],c=0;c<arguments.length;c++)b.push(arguments[c]);
699 return this.element.datepicker.apply(this.element,["hide"].concat(b))},destroy:function(){this.element.datepicker("destroy")},disable:function(){this.element.datepicker("disable")},enable:function(){this.element.datepicker("enable")},option:function(){for(var b=[],c=0;c<arguments.length;c++)b.push(arguments[c]);return this.element.datepicker.apply(this.element,["option"].concat(b))},dialog:function(){for(var b=[],c=0;c<arguments.length;c++)b.push(arguments[c]);return this.element.datepicker.apply(this.element,
700 ["dialog"].concat(b))},isDisabled:function(){return this.element.datepicker("isDisabled")},getDate:function(){return this.element.datepicker("getDate")},setDate:function(){for(var b=[],c=0;c<arguments.length;c++)b.push(arguments[c]);return this.element.datepicker.apply(this.element,["setDate"].concat(b))},ncbionclose:function(b){this.options.ncbionclose=b},_onClose:function(b,c){var d=this._getOption("ncbionclose");d&&d(b,c);this.element.trigger("ncbionclose",{dateText:b,inst:c})},ncbionselect:function(b){this.options.ncbionselect=
701 b},_onSelect:function(b,c){var d=this._getData("ncbionselect");d&&d(b,c);this.element.trigger("ncbionselect",{dateText:b,inst:c})}})})(jQuery);
702 (function(a){a.widget("ui.slider",a.ui.mouse,{widgetEventPrefix:"slide",options:{animate:false,distance:0,max:100,min:0,orientation:"horizontal",range:false,step:1,value:0,values:null},_create:function(){var b=this,c=this.options,d=this.element.find(".ui-slider-handle").addClass("ui-state-default ui-corner-all"),f=c.values&&c.values.length||1,g=[];this._mouseSliding=this._keySliding=false;this._animateOff=true;this._handleIndex=null;this._detectOrientation();this._mouseInit();this.element.addClass("ui-slider ui-slider-"+
703 this.orientation+" ui-widget ui-widget-content ui-corner-all"+(c.disabled?" ui-slider-disabled ui-disabled":""));this.range=a([]);if(c.range){if(c.range===true){if(!c.values)c.values=[this._valueMin(),this._valueMin()];if(c.values.length&&c.values.length!==2)c.values=[c.values[0],c.values[0]]}this.range=a("<div></div>").appendTo(this.element).addClass("ui-slider-range ui-widget-header"+(c.range==="min"||c.range==="max"?" ui-slider-range-"+c.range:""))}for(var i=d.length;i<f;i+=1)g.push("<a class='ui-slider-handle ui-state-default ui-corner-all' href='#'></a>");
704 this.handles=d.add(a(g.join("")).appendTo(b.element));this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(e){e.preventDefault()}).hover(function(){c.disabled||a(this).addClass("ui-state-hover")},function(){a(this).removeClass("ui-state-hover")}).focus(function(){if(c.disabled)a(this).blur();else{a(".ui-slider .ui-state-focus").removeClass("ui-state-focus");a(this).addClass("ui-state-focus")}}).blur(function(){a(this).removeClass("ui-state-focus")});this.handles.each(function(e){a(this).data("index.ui-slider-handle",
705 e)});this.handles.keydown(function(e){var h=true,j=a(this).data("index.ui-slider-handle"),k,l,n;if(!b.options.disabled){switch(e.keyCode){case a.ui.keyCode.HOME:case a.ui.keyCode.END:case a.ui.keyCode.PAGE_UP:case a.ui.keyCode.PAGE_DOWN:case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:h=false;if(!b._keySliding){b._keySliding=true;a(this).addClass("ui-state-active");k=b._start(e,j);if(k===false)return}break}n=b.options.step;k=b.options.values&&b.options.values.length?
706 (l=b.values(j)):(l=b.value());switch(e.keyCode){case a.ui.keyCode.HOME:l=b._valueMin();break;case a.ui.keyCode.END:l=b._valueMax();break;case a.ui.keyCode.PAGE_UP:l=b._trimAlignValue(k+(b._valueMax()-b._valueMin())/5);break;case a.ui.keyCode.PAGE_DOWN:l=b._trimAlignValue(k-(b._valueMax()-b._valueMin())/5);break;case a.ui.keyCode.UP:case a.ui.keyCode.RIGHT:if(k===b._valueMax())return;l=b._trimAlignValue(k+n);break;case a.ui.keyCode.DOWN:case a.ui.keyCode.LEFT:if(k===b._valueMin())return;l=b._trimAlignValue(k-
707 n);break}b._slide(e,j,l);return h}}).keyup(function(e){var h=a(this).data("index.ui-slider-handle");if(b._keySliding){b._keySliding=false;b._stop(e,h);b._change(e,h);a(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider");this._mouseDestroy();
708 return this},_mouseCapture:function(b){var c=this.options,d,f,g,i,e;if(c.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();d=this._normValueFromMouse({x:b.pageX,y:b.pageY});f=this._valueMax()-this._valueMin()+1;i=this;this.handles.each(function(h){var j=Math.abs(d-i.values(h));if(f>j){f=j;g=a(this);e=h}});if(c.range===true&&this.values(1)===c.min){e+=1;g=a(this.handles[e])}if(this._start(b,e)===false)return false;
709 this._mouseSliding=true;i._handleIndex=e;g.addClass("ui-state-active").focus();c=g.offset();this._clickOffset=!a(b.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:b.pageX-c.left-g.width()/2,top:b.pageY-c.top-g.height()/2-(parseInt(g.css("borderTopWidth"),10)||0)-(parseInt(g.css("borderBottomWidth"),10)||0)+(parseInt(g.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(b,e,d);return this._animateOff=true},_mouseStart:function(){return true},_mouseDrag:function(b){var c=
710 this._normValueFromMouse({x:b.pageX,y:b.pageY});this._slide(b,this._handleIndex,c);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(b){var c;if(this.orientation==="horizontal"){c=
711 this.elementSize.width;b=b.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{c=this.elementSize.height;b=b.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}c=b/c;if(c>1)c=1;if(c<0)c=0;if(this.orientation==="vertical")c=1-c;b=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+c*b)},_start:function(b,c){var d={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){d.value=this.values(c);
712 d.values=this.values()}return this._trigger("start",b,d)},_slide:function(b,c,d){var f;if(this.options.values&&this.options.values.length){f=this.values(c?0:1);if(this.options.values.length===2&&this.options.range===true&&(c===0&&d>f||c===1&&d<f))d=f;if(d!==this.values(c)){f=this.values();f[c]=d;b=this._trigger("slide",b,{handle:this.handles[c],value:d,values:f});this.values(c?0:1);b!==false&&this.values(c,d,true)}}else if(d!==this.value()){b=this._trigger("slide",b,{handle:this.handles[c],value:d});
713 b!==false&&this.value(d)}},_stop:function(b,c){var d={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){d.value=this.values(c);d.values=this.values()}this._trigger("stop",b,d)},_change:function(b,c){if(!this._keySliding&&!this._mouseSliding){var d={handle:this.handles[c],value:this.value()};if(this.options.values&&this.options.values.length){d.value=this.values(c);d.values=this.values()}this._trigger("change",b,d)}},value:function(b){if(arguments.length){this.options.value=
714 this._trimAlignValue(b);this._refreshValue();this._change(null,0)}else return this._value()},values:function(b,c){var d,f,g;if(arguments.length>1){this.options.values[b]=this._trimAlignValue(c);this._refreshValue();this._change(null,b)}else if(arguments.length)if(a.isArray(arguments[0])){d=this.options.values;f=arguments[0];for(g=0;g<d.length;g+=1){d[g]=this._trimAlignValue(f[g]);this._change(null,g)}this._refreshValue()}else return this.options.values&&this.options.values.length?this._values(b):
715 this.value();else return this._values()},_setOption:function(b,c){var d,f=0;if(a.isArray(this.options.values))f=this.options.values.length;a.Widget.prototype._setOption.apply(this,arguments);switch(b){case "disabled":if(c){this.handles.filter(".ui-state-focus").blur();this.handles.removeClass("ui-state-hover");this.handles.propAttr("disabled",true);this.element.addClass("ui-disabled")}else{this.handles.propAttr("disabled",false);this.element.removeClass("ui-disabled")}break;case "orientation":this._detectOrientation();
716 this.element.removeClass("ui-slider-horizontal ui-slider-vertical").addClass("ui-slider-"+this.orientation);this._refreshValue();break;case "value":this._animateOff=true;this._refreshValue();this._change(null,0);this._animateOff=false;break;case "values":this._animateOff=true;this._refreshValue();for(d=0;d<f;d+=1)this._change(null,d);this._animateOff=false;break}},_value:function(){var b=this.options.value;return b=this._trimAlignValue(b)},_values:function(b){var c,d;if(arguments.length){c=this.options.values[b];
717 return c=this._trimAlignValue(c)}else{c=this.options.values.slice();for(d=0;d<c.length;d+=1)c[d]=this._trimAlignValue(c[d]);return c}},_trimAlignValue:function(b){if(b<=this._valueMin())return this._valueMin();if(b>=this._valueMax())return this._valueMax();var c=this.options.step>0?this.options.step:1,d=(b-this._valueMin())%c;b=b-d;if(Math.abs(d)*2>=c)b+=d>0?c:-c;return parseFloat(b.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max},_refreshValue:function(){var b=
718 this.options.range,c=this.options,d=this,f=!this._animateOff?c.animate:false,g,i={},e,h,j,k;if(this.options.values&&this.options.values.length)this.handles.each(function(l){g=(d.values(l)-d._valueMin())/(d._valueMax()-d._valueMin())*100;i[d.orientation==="horizontal"?"left":"bottom"]=g+"%";a(this).stop(1,1)[f?"animate":"css"](i,c.animate);if(d.options.range===true)if(d.orientation==="horizontal"){if(l===0)d.range.stop(1,1)[f?"animate":"css"]({left:g+"%"},c.animate);if(l===1)d.range[f?"animate":"css"]({width:g-
719 e+"%"},{queue:false,duration:c.animate})}else{if(l===0)d.range.stop(1,1)[f?"animate":"css"]({bottom:g+"%"},c.animate);if(l===1)d.range[f?"animate":"css"]({height:g-e+"%"},{queue:false,duration:c.animate})}e=g});else{h=this.value();j=this._valueMin();k=this._valueMax();g=k!==j?(h-j)/(k-j)*100:0;i[d.orientation==="horizontal"?"left":"bottom"]=g+"%";this.handle.stop(1,1)[f?"animate":"css"](i,c.animate);if(b==="min"&&this.orientation==="horizontal")this.range.stop(1,1)[f?"animate":"css"]({width:g+"%"},
720 c.animate);if(b==="max"&&this.orientation==="horizontal")this.range[f?"animate":"css"]({width:100-g+"%"},{queue:false,duration:c.animate});if(b==="min"&&this.orientation==="vertical")this.range.stop(1,1)[f?"animate":"css"]({height:g+"%"},c.animate);if(b==="max"&&this.orientation==="vertical")this.range[f?"animate":"css"]({height:100-g+"%"},{queue:false,duration:c.animate})}}});a.extend(a.ui.slider,{version:"1.8.17"})})(jQuery);jQuery.widget("ui.ncbislider",{options:{},_create:function(){},destroy:function(){}});